]> git.wh0rd.org - dump.git/blobdiff - common/dumprmt.c
Regenerate configure.
[dump.git] / common / dumprmt.c
index 7f88f63a9fb95851eec469556015230170bde7ac..ba824f27d70593fef1917c75a12cc8ad9f2f5420 100644 (file)
@@ -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 <config.h>
@@ -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"));
 }