From 3c56f42b47321c00d3f5b0c99e151f1293fd31b5 Mon Sep 17 00:00:00 2001 From: grant Date: Wed, 12 Feb 2003 15:18:28 +0000 Subject: change a couple #ifdef's so /usr/bin/progress doesn't stomp all over the tty if it's not in the foreground. ok'd by jhawk. --- progressbar.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'progressbar.c') diff --git a/progressbar.c b/progressbar.c index c1a3a28..c77bb53 100644 --- a/progressbar.c +++ b/progressbar.c @@ -1,4 +1,4 @@ -/* $NetBSD: progressbar.c,v 1.1 2003/01/21 16:08:08 jhawk Exp $ */ +/* $NetBSD: progressbar.c,v 1.2 2003/02/12 15:18:28 grant Exp $ */ /*- * Copyright (c) 1997-2003 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ #include #ifndef lint -__RCSID("$NetBSD: progressbar.c,v 1.1 2003/01/21 16:08:08 jhawk Exp $"); +__RCSID("$NetBSD: progressbar.c,v 1.2 2003/02/12 15:18:28 grant Exp $"); #endif /* not lint */ /* @@ -95,7 +95,7 @@ __RCSID("$NetBSD: progressbar.c,v 1.1 2003/01/21 16:08:08 jhawk Exp $"); #include "progressbar.h" -#if !defined(NO_PROGRESS) && !defined(STANDALONE_PROGRESS) +#if !defined(NO_PROGRESS) /* * return non-zero if we're the current foreground process */ @@ -109,7 +109,7 @@ foregroundproc(void) return (tcgetpgrp(fileno(ttyout)) == pgrp); } -#endif /* !defined(NO_PROGRESS) && !defined(STANDALONE_PROGRESS) */ +#endif /* !defined(NO_PROGRESS) */ #ifndef NO_PROGRESS @@ -230,14 +230,11 @@ progressmeter(int flag) return; len = 0; -#ifndef STANDALONE_PROGRESS /* * print progress bar only if we are foreground process. */ if (! foregroundproc()) return; -#endif /* !STANDALONE_PROGRESS */ - len += snprintf(buf + len, BUFLEFT, "\r"); if (filesize > 0) { -- cgit v1.2.3-56-ge451