mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 13:31:48 +00:00
Merge pull request #11048 from opensourcerouting/fix/fsync_before_fclose
vtysh: Call fflush+fsync before calling fclose() when saving the config
This commit is contained in:
commit
4069e53960
@ -3361,6 +3361,18 @@ int vtysh_write_config_integrated(void)
|
||||
err++;
|
||||
}
|
||||
|
||||
if (fflush(fp) != 0) {
|
||||
printf("%% Warning: fflush() failed on %s: %s\n", frr_config,
|
||||
safe_strerror(errno));
|
||||
err++;
|
||||
}
|
||||
|
||||
if (fsync(fd) < 0) {
|
||||
printf("%% Warning: fsync() failed on %s: %s\n", frr_config,
|
||||
safe_strerror(errno));
|
||||
err++;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
printf("Integrated configuration saved to %s\n", frr_config);
|
||||
|
Loading…
Reference in New Issue
Block a user