commit - 14ae3944ec7b3c26fedacdad6a3bea52cd1eb69e
commit + 5d0dedb3fb1363a2f04e15ddc46ea427e40db91c
blob - bbf38dbad9efedadce54a233c29207ce0bbf6ccd
blob + b850a5a3288dd240db30eeed8d7d6b7dc35118a3
--- kamiftp/ftp.c
+++ kamiftp/ftp.c
w = tty_width;
if (pre == NULL ||
- ((l = printf("\r%s ", pre)) == -1 || l >= w))
+ ((l = fprintf(stderr, "\r%s ", pre)) == -1 || l >= w))
return;
w -= l + 2 + 5; /* 2 for |, 5 for percentage + \n */
if (w < 0) {
- printf("%4d%%\n", (int)perc);
+ fprintf(stderr, "%4d%%\n", (int)perc);
return;
}
- printf("|");
+ fprintf(stderr, "|");
l = w * MIN(100.0, perc) / 100.0;
for (i = 0; i < l; i++)
- printf("*");
+ fprintf(stderr, "*");
for (; i < w; i++)
- printf(" ");
- printf("|%4d%%", (int)perc);
-
- fflush(stdout);
+ fprintf(stderr, " ");
+ fprintf(stderr, "|%4d%%", (int)perc);
}
static int
nfid = nextfid();
errstr = walk_path(pwdfid, nfid, path, &miss, &qid);
if (errstr != NULL && miss > 1) {
- printf("%s: %s\n", path, errstr);
+ fprintf(stderr, "%s: %s\n", path, errstr);
free(errstr);
return -1;
}
*/
if (strlcpy(p, path, sizeof(p)) >= sizeof(p)) {
- printf("path too long: %s\n", path);
+ fprintf(stderr, "path too long: %s\n", path);
return -1;
}
dn = dirname(p);
errstr = walk_path(pwdfid, nfid, dn, &miss, &qid);
if (errstr != NULL) {
- printf("%s: %s\n", dn, errstr);
+ fprintf(stderr, "%s: %s\n", dn, errstr);
free(errstr);
return -1;
}
if (miss != 0) {
- printf("%s: not a directory\n", dn);
+ fprintf(stderr, "%s: not a directory\n", dn);
return -1;
}
free(errstr);
if (miss > 1) {
- printf("can't create %s: missing %d path component(s)\n",
- path, miss);
+ fprintf(stderr, "can't create %s: missing %d path"
+ " component(s)\n", path, miss);
return -1;
}
int nfid, miss, fd;
char *errstr;
- printf("connecting to %s:%s...", host, port);
- fflush(stdout);
+ fprintf(stderr, "connecting to %s:%s...", host, port);
if (tls) {
struct tls_config *conf;
fatal("fdopen");
}
- printf(" done!\n");
+ fprintf(stderr, " done!\n");
do_version();
do_attach(user);