]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3257. [bug] Do not generate a error message when calling fsync()
authorMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 08:49:01 +0000 (08:49 +0000)
committerMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 08:49:01 +0000 (08:49 +0000)
                        in a pipe or socket. [RT #27109]

CHANGES
lib/isc/unix/stdio.c

diff --git a/CHANGES b/CHANGES
index a34cc1573a5e031b52c6c435b620f9e156181dac..810c330dfd7020e50aee6278d450d0ba8284e244 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3257.  [bug]           Do not generate a error message when calling fsync()
+                       in a pipe or socket. [RT #27109]
+
 3256.  [bug]           Disable empty zones for lwresd -C. [RT #27139]
 
 3255.  [func]          No longer require that a empty zones be explicitly
index 95d9d788a47d80da24df8011db7951a6402422ee..88b5c677e8c9ad60f2820de5788b223247c5ce6c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: stdio.c,v 1.10 2011/03/05 23:52:31 tbox Exp $ */
+/* $Id: stdio.c,v 1.11 2011/12/22 08:49:01 marka Exp $ */
 
 #include <config.h>
 
@@ -110,7 +110,11 @@ isc_stdio_sync(FILE *f) {
        int r;
 
        r = fsync(fileno(f));
-       if (r == 0)
+       /*
+        * fsync is not supported on sockets and pipes which
+        * result in EINVAL / ENOTSUP.
+        */
+       if (r == 0 || errno == EINVAL || errno == ENOTSUP)
                return (ISC_R_SUCCESS);
        else
                return (isc__errno2result(errno));