]> 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:53:32 +0000 (08:53 +0000)
committerMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 08:53:32 +0000 (08:53 +0000)
                        in a pipe or socket. [RT #27109]

CHANGES
lib/isc/unix/stdio.c

diff --git a/CHANGES b/CHANGES
index a0ccc826db7ddbdff939949f674ed1a11e735ad0..c2624a4ee812129959afcc8cae6c4c811862feee 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]
 
 3254.  [bug]           Set isc_socket_ipv6only() on the IPv6 control channels.
index 71f734a3b666288075cf7d738ef7961ac440dbb1..6487abe8b293e6c203dacc00f8331b39dce232b5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: stdio.c,v 1.8.332.2 2011/03/12 04:57:32 tbox Exp $ */
+/* $Id: stdio.c,v 1.8.332.3 2011/12/22 08:53:32 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));