Greg Troxel <gdt@...> wrote:
> fflush()
> fsync()
> fclose()
So we would do that?
Index: dump.c
===================================================================
RCS file: /milter-greylist/milter-greylist/dump.c,v
retrieving revision 1.35
diff -U2 -r1.35 dump.c
--- dump.c 29 Dec 2007 19:06:49 -0000 1.35
+++ dump.c 20 Mar 2009 20:30:02 -0000
@@ -288,5 +288,13 @@
"whitelisted\n#\n", done, greylisted_count,
whitelisted_count);
- Fclose(dump);
+ /*
+ * Ensure that the data is really flushed to disk.
+ * Some systems might delay the data write from kernel buffer
+ * to disk even after the file is closed
+ */
+ (void)fflush(dump);
+ (void)fsync(fileno(dump));
+ (void)Fclose(dump);
+
if (s_buffer)
free(s_buffer);
--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...Message
Re: [milter-greylist] ext4fs reliability bug
2009-03-20 by manu@netbsd.org
Attachments
- No local attachments were found for this message.