chroot: suppress error messages if the chroot pipe is closed
authorLennart Poettering <lennart@poettering.net>
Tue, 8 Mar 2011 22:57:50 +0000 (23:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Mar 2011 22:57:50 +0000 (23:57 +0100)
avahi-daemon/chroot.c

index d796a39..ccd56be 100644 (file)
@@ -394,12 +394,14 @@ int avahi_chroot_helper_unlink(const char *fname) {
             return -1;
         }
 
-        if (write(helper_fd, &command, sizeof(command)) < 0) {
+        if (write(helper_fd, &command, sizeof(command)) < 0 &&
+            (errno != EPIPE && errno != ECONNRESET)) {
             avahi_log_error("write() failed: %s\n", strerror(errno));
             return -1;
         }
 
-        if ((r = read(helper_fd, &c, sizeof(c))) < 0) {
+        if ((r = read(helper_fd, &c, sizeof(c))) < 0 &&
+            (errno != EPIPE && errno != ECONNRESET)) {
             avahi_log_error("read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
             return -1;
         }