Browse Source

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.
tags/debian/1.8.0_rc1
Michael Vogt 2 years ago
parent
commit
6af48a7f83
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      apt-private/private-json-hooks.cc

+ 1
- 1
apt-private/private-json-hooks.cc View File

@@ -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;
}


Loading…
Cancel
Save