Use right function pfSense_fsync to make sure config file is safe on disk, ticket #4803

This commit is contained in:
Renato Botelho 2015-07-06 12:42:45 -03:00
parent 8cbb22c653
commit d0577bd23e

View File

@ -379,7 +379,7 @@ function conf_mount_ro() {
clear_subsystem_dirty('mount');
/* sync data, then force a remount of /cf */
pfSense_sync();
pfSense_fsync($g['cf_path']);
mwexec("/sbin/mount -u -r -f -o sync,noatime {$g['cf_path']}");
mwexec("/sbin/mount -u -r -f -o sync,noatime /");
}
@ -493,9 +493,7 @@ function safe_write_file($file, $content, $force_binary) {
}
// Sync file before returning
pfSense_sync();
return true;
return pfSense_fsync(dirname($file));
}
/****f* config/write_config