Changeset 767


Ignore:
Timestamp:
2011-04-18T09:16:12+02:00 (3 years ago)
Author:
moo
Message:

check return value to avoid gcc warning

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/coverager.c

    r716 r767  
    172172    p[1] = covlines; 
    173173 
    174     ftruncate(fd, 0); 
     174    if (ftruncate(fd, 0) != 0) { 
     175        goto bailout; 
     176    } 
    175177    lseek(fd, 0, SEEK_SET); 
    176     write(fd, (char *) buf, size); 
     178    if (write(fd, (char *) buf, size) != size) { 
     179        goto bailout; 
     180    } 
    177181 
    178182bailout: 
  • trunk/mmap.c

    r558 r767  
    187187        } 
    188188    } 
    189     ftruncate(fd, size); 
     189 
     190    if (ftruncate(fd, size) != 0) { 
     191        perror(shm->name); 
     192        errstr = "Failed to ftruncate the file"; 
     193        goto err; 
     194    } 
    190195#endif 
    191196 
  • trunk/xcache.c

    r764 r767  
    31563156    xcache_restore_signal_handler(); 
    31573157    if (xc_coredump_dir && xc_coredump_dir[0]) { 
    3158         chdir(xc_coredump_dir); 
     3158        if (chdir(xc_coredump_dir) != 0) { 
     3159            /* error, but nothing can do about it 
     3160             * and should'nt print anything which might SEGV again */ 
     3161        } 
    31593162    } 
    31603163    raise(sig); 
Note: See TracChangeset for help on using the changeset viewer.