From b9ef39ec37f0608012fdf60f7819d584c37f0dc4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 8 Mar 2011 23:57:50 +0100 Subject: [PATCH] chroot: suppress error messages if the chroot pipe is closed --- avahi-daemon/chroot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.39.5