When saving file do fflush/fsync, so that its content isn't lost if machine

is forcefully powered down shortly after that.
This commit is contained in:
Maxim Sobolev 2003-02-20 21:38:05 +00:00
parent 34bb5fd295
commit 8978796870
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=75988

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- src/file.c 2002/07/15 11:40:21 1.1
+++ src/file.c 2002/07/15 11:42:31
@@ -192,6 +192,8 @@
putc('\r', fp);
putc('\n', fp);
}
+ fflush(fp);
+ fsync(fileno(fp));
return 0;
}