summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-09-17 18:01:20 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-17 18:01:20 -0400
commitfbaa0680a0e7207d2274fed1b196e1c94f21c1c1 (patch)
tree73c58b21620b22aa62b206af2d417de3b8a199cf
parent79976cb5d469b04420b77079918569a0ac504dd7 (diff)
downloadqarsh-fbaa0680a0e7207d2274fed1b196e1c94f21c1c1.zip
qarsh-fbaa0680a0e7207d2274fed1b196e1c94f21c1c1.tar.gz
qarsh-fbaa0680a0e7207d2274fed1b196e1c94f21c1c1.tar.xz
Say something if we can't write to stdout
-rw-r--r--qarsh.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qarsh.c b/qarsh.c
index 50bde2a..61c73e2 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -288,6 +288,8 @@ run_remote_cmd(char *cmdline)
if (nbytes == z_out) {
z_out = 0;
if (eof_out) close(fileno(stdout));
+ } else if (nbytes == -1) {
+ fprintf(stderr, "Error writing to stdout: %s\n", strerror(errno));
} else {
memmove(b_out, b_out+nbytes, z_out - nbytes);
z_out -= nbytes;