summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Jansa <djansa@redhat.com>2005-09-13 21:49:10 +0000
committerNathan Straz <nstraz@redhat.com>2008-09-23 09:37:44 -0400
commitbd083c50264fcefcf4454401793c0dc43e8a3d62 (patch)
tree5cc31873162f932dafe7a5c33cd0bd067482227f
parentdc0208b08c7df7c0e559b021bdffcebdb2dc221e (diff)
downloadqarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.zip
qarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.tar.gz
qarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.tar.xz
Clean up printing of file xfers.
-rw-r--r--qacp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/qacp.c b/qacp.c
index 90185dd..ccfcff8 100644
--- a/qacp.c
+++ b/qacp.c
@@ -32,6 +32,7 @@
/* Globals */
int qacp_fd = -1; /* The control connection to qacpd */
+short quiet = 0;
void
usage()
@@ -156,6 +157,10 @@ qacp_sendonefile(const char *host, const char *srcfile, const char *destfile)
exit(125);
}
+ if (!quiet) {
+ printf("%-30.30s -> %s:%s\n", srcfile, host, destfile);
+ }
+
return;
}
@@ -246,13 +251,17 @@ qacp_recvonefile(const char *host, const char *srcfile, const char *destfile)
close(qacp_fd);
exit(125);
}
+
+ if (!quiet) {
+ printf("%s:%s -> %30.30s\n", host, srcfile, destfile);
+ }
return;
}
int
-recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet)
+recvfiles(char **argv, int argc, int fileidx, short recursive)
{
char *cp;
char *rhost = NULL;
@@ -392,10 +401,6 @@ recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet)
free(cp);
free(rbnp);
} else {
- if (!quiet) {
- printf("%s:%s -> %30.30s\n",
- rhost, rmtpath, destpath);
- }
qacp_recvonefile(rhost, rmtpath, destpath);
}
}
@@ -416,7 +421,7 @@ recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet)
int
-sendfiles(char **argv, int argc, int fileidx, short recursive, short quiet)
+sendfiles(char **argv, int argc, int fileidx, short recursive)
{
char *cp;
char *rhost = NULL;
@@ -526,10 +531,6 @@ sendfiles(char **argv, int argc, int fileidx, short recursive, short quiet)
}
}
- if (!quiet) {
- printf("%-30.30s -> %s:%s\n", argv[file], rhost, destpath);
- }
-
qacp_sendonefile(rhost, argv[file], destpath);
free(lbnp);
@@ -545,7 +546,6 @@ main(int argc, char *argv[])
{
int c;
short recursive=0;
- short quiet=0;
int eflag;
while ((c = getopt(argc, argv, "+rq")) != -1) {
@@ -574,11 +574,11 @@ main(int argc, char *argv[])
eflag = 0;
/* If last arg has a ':' then we are sending files */
if (strchr(argv[argc-1], ':') != NULL) {
- if (sendfiles(argv, argc, optind, recursive, quiet) < 0) {
+ if (sendfiles(argv, argc, optind, recursive) < 0) {
eflag++;
}
} else {
- if (recvfiles(argv, argc, optind, recursive, quiet) < 0) {
+ if (recvfiles(argv, argc, optind, recursive) < 0) {
eflag++;
}
}