summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2019-01-29 10:17:33 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-02-05 13:35:13 +0100
commit112f85e3df3bf612f1c74119ec1e9cdfa827d03b (patch)
tree7298408b8f1eb455717a297aa594c3e0cb5b26ad /apt-private
parentee7b0227a29796db8c2d5986db7fcf7073ce8dfd (diff)
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. (cherry picked from commit 6af48a7f83540c807be1d2777470d23e6b260eb8) LP: #1814543 (cherry picked from commit 97412ac47a974b1eb0e8280cf11b3b80ff1ba17f)
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-json-hooks.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc
index 0e4b4913b..e3a800b35 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;
}