summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-09-19 17:41:05 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-19 17:41:05 -0400
commit09d3e306d9a8269183303dd3e3b3279f09c4115f (patch)
treef904ac70722f4202499c7508e74b8208112dd31a
parent2da3d279e360bfb4ac470874d4b43b765b6596fa (diff)
downloadqarsh-09d3e306d9a8269183303dd3e3b3279f09c4115f.tar.gz
qarsh-09d3e306d9a8269183303dd3e3b3279f09c4115f.tar.xz
qarsh-09d3e306d9a8269183303dd3e3b3279f09c4115f.zip
Only print an error if we didn't hit a broken pipe
-rw-r--r--qarsh.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/qarsh.c b/qarsh.c
index 2683591..9081ee3 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -396,9 +396,12 @@ run_remote_cmd(char *cmdline)
qp->qp_dallow.qp_remfd);
}
} else if (qp->qp_type == QP_RETURNCODE) { /* qarshd hit an error while writing to stdin */
- fprintf(stderr, "Remote command hit I/O error: %s\n", qp->qp_returncode.qp_strerror);
- close(fileno(stdin));
- allowed_in = -1;
+ if (qp->qp_returncode.qp_rc == -1 && qp->qp_returncode.qp_errno == EPIPE) {
+ close(fileno(stdin));
+ allowed_in = -1;
+ } else {
+ fprintf(stderr, "Remote command hit I/O error: %s\n", qp->qp_returncode.qp_strerror);
+ }
} else {
fprintf(stderr, "Unexpected packet type %s\n", qp_packet_type(qp->qp_type));
}