Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1555 - trunk: . fsvs/src

fsvs
Discussion topic

Back to topic list

svn commit: r1555 - trunk: . fsvs/src

Author pmarek
Full name P.Marek
Date 2008-03-18 23:42:02 PDT
Message Author: pmarek
Date: 2008-03-18 23:42:02-0700
New Revision: 1555

Modified:
   trunk/ (props changed)
   trunk/fsvs/src/ignore.c

Log:
Bugfixes - if the open() succeeds, but mmap() does not (eg. because it's a
directory instead of a file), we shouldn't crash.




Modified: trunk/fsvs/src/ignore.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/ign​ore.c?view=diff&​rev=1555&p1=trun​k/fsvs/src/ignore.c​&p2=trunk/fsvs/sr​c/ignore.c&r1=15​54&r2=1555
====================​====================​====================​==================
--- trunk/fsvs/src/ignore.c (original)
+++ trunk/fsvs/src/ignore.c 2008-03-18 23:42:02-0700
@@ -902,12 +902,12 @@
      * Always close the file. Check close() return code afterwards. */
     status=errno;
     l=close(fh);
- STOPIF_CODE_ERR( !memory, status, "mmap failed");
+ STOPIF_CODE_ERR( memory == MAP_FAILED, status, "mmap failed");
     STOPIF_CODE_ERR( l, errno, "close() failed");
 
 
     /* make header \0 terminated */
- cp=strchr(memory, '\n');
+ cp=memchr(memory, '\n', st.st_size);
     if (!cp)
     {
         /* This means no entries.

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1555 - trunk: . fsvs/src pmarek P.Marek 2008-03-18 23:42:02 PDT
Messages per page: