]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/rmtab.c
rpc.mountd: make exportent->e_hostname a dynamically-allocated string
[nfs-utils.git] / support / nfs / rmtab.c
index da40e486a052e45de082bf8dd654cbefd2e6bcc1..4cbd28591270a184b68e7ecedddc4828080814bb 100644 (file)
@@ -6,7 +6,9 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <sys/fcntl.h>
 #include <stdlib.h>
@@ -114,8 +116,14 @@ endrmtabent(void)
 void
 fendrmtabent(FILE *fp)
 {
-       if (fp)
+       if (fp) {
+               /* If it was written to, we really want
+                * to flush to disk before returning
+                */
+               fflush(fp);
+               fdatasync(fileno(fp));
                fclose(fp);
+       }
 }
 
 void