lib/socket-util.c
/* Given file name 'file_name', fsyncs the directory in which it is contained.
 * Returns 0 if successful, otherwise a positive errno value. */
Given file name 'file_name', fsyncs the directory in which it is contained.
Returns 0 if successful, otherwise a positive errno value.
Given file name ' file_name ' fsyncs the directory in which it is contained . Returns 0 if successful otherwise a positive errno value .
int
fsync_parent_dir(const char *file_name)
{
    int error = 0;
#ifndef _WIN32
    char *dir;
    int fd;
    dir = dir_name(file_name);
    fd = open(dir, O_RDONLY);
    if (fd >= 0) {
        if (fsync(fd)) {
            if (errno == EINVAL || errno == EROFS) {
            } else {
                error = errno;
                VLOG_ERR("%s: fsync failed (%s)", dir, ovs_strerror(error));
            }
        }
        close(fd);
    } else {
        error = errno;
        VLOG_ERR("%s: open failed (%s)", dir, ovs_strerror(error));
    }
    free(dir);
#endif
    return error;
}
int fsync_parent_dir ( const char * file_name ) { int error = 0 ; #ifndef _WIN32 char * dir ; int fd ; dir = dir_name ( file_name ) ; fd = open ( dir , O_RDONLY ) ; if ( fd >= 0 ) { if ( fsync ( fd ) ) { if ( errno == EINVAL || errno == EROFS ) { } else { error = errno ; VLOG_ERR ( " " , dir , ovs_strerror ( error ) ) ; } } close ( fd ) ; } else { error = errno ; VLOG_ERR ( " " , dir , ovs_strerror ( error ) ) ; } free ( dir ) ; #endif return error ; }
Given file name 'file_name', fsyncs the directory in which it is contained.
Given file name ' file_name ' fsyncs the directory in which it is contained .
/* This directory does not support synchronization.  Not
                 * really an error. */