Browse Source

check return value to avoid gcc warning

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@767 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent
commit
fcf274966f
  1. 8
      coverager.c
  2. 7
      mmap.c
  3. 5
      xcache.c

8
coverager.c

@ -171,9 +171,13 @@ static void xc_coverager_save_cov(char *srcfile, char *outfilename, coverager_t
p[0] = 0;
p[1] = covlines;
ftruncate(fd, 0);
if (ftruncate(fd, 0) != 0) {
goto bailout;
}
lseek(fd, 0, SEEK_SET);
write(fd, (char *) buf, size);
if (write(fd, (char *) buf, size) != size) {
goto bailout;
}
bailout:
if (contents) efree(contents);

7
mmap.c

@ -186,7 +186,12 @@ static XC_SHM_INIT(xc_mmap_init) /* {{{ */
goto err;
}
}
ftruncate(fd, size);
if (ftruncate(fd, size) != 0) {
perror(shm->name);
errstr = "Failed to ftruncate the file";
goto err;
}
#endif
#ifdef ZEND_WIN32

5
xcache.c

@ -3155,7 +3155,10 @@ static void xcache_signal_handler(int sig) /* {{{ */
{
xcache_restore_signal_handler();
if (xc_coredump_dir && xc_coredump_dir[0]) {
chdir(xc_coredump_dir);
if (chdir(xc_coredump_dir) != 0) {
/* error, but nothing can do about it
* and should'nt print anything which might SEGV again */
}
}
raise(sig);
}

Loading…
Cancel
Save