From 6af48a7f83540c807be1d2777470d23e6b260eb8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 29 Jan 2019 10:17:33 +0100 Subject: private-json-hooks.cc: deal with EPIPE While running our CI we noticed that sometimes we see an error from the new json hooks code. The error message is: ``` E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Broken pipe ``` when purging the snapd package which provides the hook. This indicates that we should probably also consider EPIPE not an error (just like we do for ECONNRESET). This PR does exactly this. --- apt-private/private-json-hooks.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc index b5c1a7172..65ff87924 100644 --- a/apt-private/private-json-hooks.cc +++ b/apt-private/private-json-hooks.cc @@ -387,7 +387,7 @@ bool RunJsonHook(std::string const &option, std::string const &method, const cha if (size < 0) { - if (errno != ECONNRESET) + if (errno != ECONNRESET && errno != EPIPE) _error->Error("Could not read response to hello message from hook %s: %s", Opts->Value.c_str(), strerror(errno)); goto out; } -- cgit v1.2.3-70-g09d2