summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cd34547)
* remove unneeded {}s
* add some whitespace for readability
Contributed by Slava Semushin <slava.semushin@gmail.com> in private mail.
-/* $NetBSD: progress.c,v 1.12 2006/04/20 23:20:55 hubertf Exp $ */
+/* $NetBSD: progress.c,v 1.13 2007/02/07 14:06:57 hubertf Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
#include <sys/cdefs.h>
#ifndef lint
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: progress.c,v 1.12 2006/04/20 23:20:55 hubertf Exp $");
+__RCSID("$NetBSD: progress.c,v 1.13 2007/02/07 14:06:57 hubertf Exp $");
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/ftp.h>
#include <netinet/in.h>
#include <arpa/ftp.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
fprintf(stderr,
"usage: %s [-ez] [-f file] [-l length] [-p prefix] cmd [args...]\n",
getprogname());
fprintf(stderr,
"usage: %s [-ez] [-f file] [-l length] [-p prefix] cmd [args...]\n",
getprogname());
/* defaults: Read from stdin, 0 filesize (no completion estimate) */
fd = STDIN_FILENO;
filesize = 0;
/* defaults: Read from stdin, 0 filesize (no completion estimate) */
fd = STDIN_FILENO;
filesize = 0;
while ((ch = getopt(argc, argv, "ef:l:p:z")) != -1)
switch (ch) {
while ((ch = getopt(argc, argv, "ef:l:p:z")) != -1)
switch (ch) {
case 'z':
zflag++;
break;
case 'z':
zflag++;
break;
usage();
/* NOTREACHED */
}
usage();
/* NOTREACHED */
}
if (infile && (fd = open(infile, O_RDONLY, 0)) < 0)
err(1, "%s", infile);
if (infile && (fd = open(infile, O_RDONLY, 0)) < 0)
err(1, "%s", infile);
progress = 1;
ttyout = eflag ? stderr : stdout;
progress = 1;
ttyout = eflag ? stderr : stdout;
- if (ioctl(fileno(ttyout), TIOCGSIZE, &ts) == -1) {
+ if (ioctl(fileno(ttyout), TIOCGSIZE, &ts) == -1)
ttywidth = ts.ts_cols;
if (pipe(outpipe) < 0)
ttywidth = ts.ts_cols;
if (pipe(outpipe) < 0)