changeset 303:b27fcd28f9dc ucc-axis-hack

printf not fprintf for scp stuff
author Matt Johnston <matt@ucc.asn.au>
date Sat, 25 Mar 2006 13:35:44 +0000
parents 973fccb59ea4
children 1f36a94e01b9
files scp.c scpmisc.c
diffstat 2 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scp.c	Sat Mar 25 12:59:58 2006 +0000
+++ b/scp.c	Sat Mar 25 13:35:44 2006 +0000
@@ -125,10 +125,10 @@
 		fatal("do_local_cmd: no arguments");
 
 	if (verbose_mode) {
-		fprintf(stderr, "Executing:");
+		printf( "Executing:");
 		for (i = 0; i < a->num; i++)
-			fprintf(stderr, " %s", a->list[i]);
-		fprintf(stderr, "\n");
+			printf( " %s", a->list[i]);
+		printf( "\n");
 	}
 	if ((pid = fork()) == -1)
 		fatal("do_local_cmd: fork: %s", strerror(errno));
@@ -858,7 +858,7 @@
 		} while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
 		*cp = 0;
 		if (verbose_mode)
-			fprintf(stderr, "Sink: %s", buf);
+			printf( "Sink: %s", buf);
 
 		if (buf[0] == '\01' || buf[0] == '\02') {
 			if (iamremote == 0)
@@ -1146,12 +1146,12 @@
 	++errs;
 	if (fp == NULL && !(fp = fdopen(remout, "w")))
 		return;
-	(void) fprintf(fp, "%c", 0x01);
-	(void) fprintf(fp, "scp: ");
+	(void) printf( "%c", 0x01);
+	(void) printf( "scp: ");
 	va_start(ap, fmt);
-	(void) vfprintf(fp, fmt, ap);
+	(void) vprintf( fmt, ap);
 	va_end(ap);
-	(void) fprintf(fp, "\n");
+	(void) printf( "\n");
 	(void) fflush(fp);
 
 	if (!iamremote) {
--- a/scpmisc.c	Sat Mar 25 12:59:58 2006 +0000
+++ b/scpmisc.c	Sat Mar 25 13:35:44 2006 +0000
@@ -220,7 +220,7 @@
 {
 	va_list args;
 	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
+	vprintf( fmt, args);
 	va_end(args);
 	exit(255);
 }
@@ -231,7 +231,7 @@
 	int nullfd, dupfd;
 
 	if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
-		fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno));
+		printf( "Couldn't open /dev/null: %s", strerror(errno));
 		exit(1);
 	}
 	while (++dupfd <= 2) {
@@ -239,7 +239,7 @@
 		if (fcntl(dupfd, F_GETFL, 0) >= 0)
 			continue;
 		if (dup2(nullfd, dupfd) == -1) {
-			fprintf(stderr, "dup2: %s", strerror(errno));
+			printf( "dup2: %s", strerror(errno));
 			exit(1);
 		}
 	}