From 61958ba2d9f279922eaa5dacf0ec92147c5a7d14 Mon Sep 17 00:00:00 2001 From: gwr Date: Fri, 12 Dec 1997 23:34:56 +0000 Subject: [PATCH] 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?) --- usr.bin/ftp/main.c | 6 ++++-- usr.bin/ftp/util.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 44bedcaf3b22..15e7244e53ef 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -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) { diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 670cd76772b5..5f8b788fb9bc 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -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 #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 */ } /*