Kill the "progress bar" stuff when compiled with -DSMALL

because progressmeter() uses floats which are unwanted
when this is built under src/distrib/utils/x_ftp
(Maybe -DNO_FLOAT would be better?)
This commit is contained in:
gwr 1997-12-12 23:34:56 +00:00
parent 6536ca4e3e
commit 61958ba2d9
2 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.26 1997/10/14 16:31:22 christos Exp $ */
/* $NetBSD: main.c,v 1.27 1997/12/12 23:34:56 gwr Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.26 1997/10/14 16:31:22 christos Exp $");
__RCSID("$NetBSD: main.c,v 1.27 1997/12/12 23:34:56 gwr Exp $");
#endif
#endif /* not lint */
@ -154,8 +154,10 @@ main(argc, argv)
editing = 1; /* editing mode on if tty is usable */
#endif
}
#ifndef SMALL
if (isatty(fileno(stdout)) && !dumbterm)
progress = 1; /* progress bar on if tty is usable */
#endif
while ((ch = getopt(argc, argv, "adeginpP:tvV")) != -1) {
switch (ch) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.17 1997/11/01 14:37:05 lukem Exp $ */
/* $NetBSD: util.c,v 1.18 1997/12/12 23:34:57 gwr Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: util.c,v 1.17 1997/11/01 14:37:05 lukem Exp $");
__RCSID("$NetBSD: util.c,v 1.18 1997/12/12 23:34:57 gwr Exp $");
#endif /* not lint */
/*
@ -536,7 +536,8 @@ remotemodtime(file, noisy)
return (rtime);
}
void updateprogressmeter __P((int));
#ifndef SMALL
static void updateprogressmeter __P((int));
void
updateprogressmeter(dummy)
@ -555,6 +556,7 @@ updateprogressmeter(dummy)
ctty_pgrp == (int)pgrp)
progressmeter(0);
}
#endif /* SMALL */
/*
* Display a transfer progress bar if progress is non-zero.
@ -572,6 +574,7 @@ void
progressmeter(flag)
int flag;
{
#ifndef SMALL
/*
* List of order of magnitude prefixes.
* The last is `P', as 2^64 = 16384 Petabytes
@ -672,6 +675,7 @@ progressmeter(flag)
(void)putchar('\n');
}
fflush(stdout);
#endif /* SMALL */
}
/*
@ -686,6 +690,7 @@ void
ptransfer(siginfo)
int siginfo;
{
#ifndef SMALL
struct timeval now, td;
double elapsed;
off_t bs;
@ -719,6 +724,7 @@ ptransfer(siginfo)
remaining % 60);
}
(void)write(siginfo ? STDERR_FILENO : STDOUT_FILENO, buf, len);
#endif /* SMALL */
}
/*