From: Lennart Poettering Date: Tue, 8 Mar 2011 22:57:50 +0000 (+0100) Subject: chroot: suppress error messages if the chroot pipe is closed X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b9ef39ec37f0608012fdf60f7819d584c37f0dc4;p=catta chroot: suppress error messages if the chroot pipe is closed --- diff --git a/avahi-daemon/chroot.c b/avahi-daemon/chroot.c index d796a39..ccd56be 100644 --- a/avahi-daemon/chroot.c +++ b/avahi-daemon/chroot.c @@ -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; }