Projects
Browse Source     Search     Timeline     Wiki

Changeset 23359

Show
Ignore:
Timestamp:
09/06/07 15:24:34 (15 months ago)
Author:
zarzycki@…
Message:

Create a wrapper around fsync().

Location:
trunk/launchd/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchd_core_logic.c

    r23356 r23359  
    44934493 
    44944494        if (logfile_fd != -1) { 
    4495                 job_assumes(j, fcntl(logfile_fd, F_FULLFSYNC, 0) != -1); 
     4495                job_assumes(j, runtime_fsync(logfile_fd) != -1); 
    44964496                job_assumes(j, runtime_close(logfile_fd) != -1); 
    44974497        } 
  • trunk/launchd/src/launchd_runtime.c

    r23357 r23359  
    10371037{ 
    10381038        if (ourlogfile) { 
    1039                 fflush(ourlogfile); 
    1040  
    1041                 if (debug_shutdown_hangs) { 
    1042                         fcntl(fileno(ourlogfile), F_FULLFSYNC, NULL); 
    1043                 } 
     1039                launchd_assumes(fflush(ourlogfile) == 0); 
     1040                launchd_assumes(runtime_fsync(fileno(ourlogfile)) != -1); 
     1041        } 
     1042} 
     1043 
     1044int 
     1045runtime_fsync(int fd) 
     1046{ 
     1047        if (debug_shutdown_hangs) { 
     1048                return fcntl(fd, F_FULLFSYNC, NULL); 
     1049        } else { 
     1050                return fsync(fd); 
    10441051        } 
    10451052} 
  • trunk/launchd/src/launchd_runtime.h

    r23356 r23359  
    6262 
    6363int runtime_close(int fd); 
     64int runtime_fsync(int fd); 
    6465 
    6566void runtime_set_timeout(timeout_callback to_cb, mach_msg_timeout_t to);