X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common%2Fdumprmt.c;h=ba824f27d70593fef1917c75a12cc8ad9f2f5420;hb=9a0f7d31d8848683face512dcabfc03949c78fb2;hp=7f88f63a9fb95851eec469556015230170bde7ac;hpb=6ca85a1b3c0486912b19bd5e47f78e9207ba5298;p=debian%2Fdump diff --git a/common/dumprmt.c b/common/dumprmt.c index 7f88f63..ba824f2 100644 --- a/common/dumprmt.c +++ b/common/dumprmt.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dumprmt.c,v 1.28 2003/10/26 16:05:45 stelian Exp $"; + "$Id: dumprmt.c,v 1.30 2010/06/11 11:19:17 stelian Exp $"; #endif /* not lint */ #include @@ -268,7 +268,7 @@ rmtgetconn(void) perror("TCP_NODELAY setsockopt"); fromrmtape = tormtape; } - (void)fprintf(stdout, "Connection to %s established.\n", rmtpeer); + (void)fprintf(stderr, "Connection to %s established.\n", rmtpeer); return 1; } @@ -342,8 +342,10 @@ rmtwrite(const char *buf, size_t count) char line[30]; (void)snprintf(line, sizeof (line), "W%ld\n", (long)count); - write(tormtape, line, strlen(line)); - write(tormtape, buf, count); + if (write(tormtape, line, strlen(line)) != strlen(line)) + return -1; + if (write(tormtape, buf, count) != count) + return -1; return (rmtreply("write")); }