comparison scp.c @ 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
comparison
equal deleted inserted replaced
302:973fccb59ea4 303:b27fcd28f9dc
123 123
124 if (a->num == 0) 124 if (a->num == 0)
125 fatal("do_local_cmd: no arguments"); 125 fatal("do_local_cmd: no arguments");
126 126
127 if (verbose_mode) { 127 if (verbose_mode) {
128 fprintf(stderr, "Executing:"); 128 printf( "Executing:");
129 for (i = 0; i < a->num; i++) 129 for (i = 0; i < a->num; i++)
130 fprintf(stderr, " %s", a->list[i]); 130 printf( " %s", a->list[i]);
131 fprintf(stderr, "\n"); 131 printf( "\n");
132 } 132 }
133 if ((pid = fork()) == -1) 133 if ((pid = fork()) == -1)
134 fatal("do_local_cmd: fork: %s", strerror(errno)); 134 fatal("do_local_cmd: fork: %s", strerror(errno));
135 135
136 if (pid == 0) { 136 if (pid == 0) {
856 SCREWUP("lost connection"); 856 SCREWUP("lost connection");
857 *cp++ = ch; 857 *cp++ = ch;
858 } while (cp < &buf[sizeof(buf) - 1] && ch != '\n'); 858 } while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
859 *cp = 0; 859 *cp = 0;
860 if (verbose_mode) 860 if (verbose_mode)
861 fprintf(stderr, "Sink: %s", buf); 861 printf( "Sink: %s", buf);
862 862
863 if (buf[0] == '\01' || buf[0] == '\02') { 863 if (buf[0] == '\01' || buf[0] == '\02') {
864 if (iamremote == 0) 864 if (iamremote == 0)
865 (void) atomicio(vwrite, STDERR_FILENO, 865 (void) atomicio(vwrite, STDERR_FILENO,
866 buf + 1, strlen(buf + 1)); 866 buf + 1, strlen(buf + 1));
1144 va_list ap; 1144 va_list ap;
1145 1145
1146 ++errs; 1146 ++errs;
1147 if (fp == NULL && !(fp = fdopen(remout, "w"))) 1147 if (fp == NULL && !(fp = fdopen(remout, "w")))
1148 return; 1148 return;
1149 (void) fprintf(fp, "%c", 0x01); 1149 (void) printf( "%c", 0x01);
1150 (void) fprintf(fp, "scp: "); 1150 (void) printf( "scp: ");
1151 va_start(ap, fmt); 1151 va_start(ap, fmt);
1152 (void) vfprintf(fp, fmt, ap); 1152 (void) vprintf( fmt, ap);
1153 va_end(ap); 1153 va_end(ap);
1154 (void) fprintf(fp, "\n"); 1154 (void) printf( "\n");
1155 (void) fflush(fp); 1155 (void) fflush(fp);
1156 1156
1157 if (!iamremote) { 1157 if (!iamremote) {
1158 va_start(ap, fmt); 1158 va_start(ap, fmt);
1159 vprintf( fmt, ap); 1159 vprintf( fmt, ap);