diff --git a/mx_util.c b/mx_util.c index 52e890de..7f99daf2 100644 --- a/mx_util.c +++ b/mx_util.c @@ -1360,7 +1360,7 @@ static char *mx_call_external_v(char *helper, char **argv) { goto err_close; } if (len == sizeof(buf)) { - err = EPIPE; + err = EPROTO; goto err_close; } @@ -1369,7 +1369,7 @@ static char *mx_call_external_v(char *helper, char **argv) { int wstatus; waitpid(pid, &wstatus, 0); if (wstatus != 0) { - err = EPIPE; + err = EPROTO; goto err_err; } buf[len] = '\0'; diff --git a/test_mx_util.c b/test_mx_util.c index e55d0070..028a9ebb 100644 --- a/test_mx_util.c +++ b/test_mx_util.c @@ -545,13 +545,13 @@ static void test_mx_call_external() { assert(errno == 999); line = mx_call_external("/usr/bin/false", NULL); - assert(line == NULL && errno==EPIPE); + assert(line == NULL && errno==EPROTO); line = mx_call_external("/usr/bin/cat", "/usr/bin/bash", NULL); - assert(line == NULL && errno==EPIPE); + assert(line == NULL && errno==EPROTO); line = mx_call_external("/usr/bin/yes", NULL); - assert(line == NULL && errno==EPIPE); + assert(line == NULL && errno==EPROTO); }