diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-18 09:28:11 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-18 09:28:11 +1100 |
commit | 81428f9d10e81d9fe2e4af10df0c4e38d1192d70 (patch) | |
tree | b19982baa6558d387f3537ef67d64a5f6a38ebd0 /scp.c | |
parent | 10f6f6ba9ee14d306f8780edee8a10640c1643e0 (diff) | |
download | openssh-git-81428f9d10e81d9fe2e4af10df0c4e38d1192d70.tar.gz |
- Merged OpenBSD CVS changes
- [scp.c] foregroundproc() in scp
- [sshconnect.h] include fingerprint.h
- [sshd.c] bugfix: the log() for passwd-auth escaped during logging
changes.
- Added openssh.com info to README
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -42,11 +42,11 @@ and ssh has the necessary privileges.) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ + * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $"); +RCSID("$Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -976,7 +976,7 @@ run_err(const char *fmt, ...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ + * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ */ char * @@ -1112,6 +1112,19 @@ updateprogressmeter(void) errno = save_errno; } +int +foregroundproc() +{ + static pid_t pgrp = -1; + int ctty_pgrp; + + if (pgrp == -1) + pgrp = getpgrp(); + + return((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && + ctty_pgrp == pgrp)); +} + void progressmeter(int flag) { @@ -1129,6 +1142,9 @@ progressmeter(int flag) lastupdate = start; lastsize = 0; } + if (foregroundproc() == 0) + return; + (void)gettimeofday(&now, (struct timezone *)0); cursize = statbytes; if (totalbytes != 0) { @@ -1145,10 +1161,10 @@ progressmeter(int flag) if (barlength > 0) { i = barlength * ratio / 100; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "|%.*s%*s|", i, + "|%.*s%*s|", i, "*****************************************************************************" "*****************************************************************************", - barlength - i, ""); + barlength - i, ""); } i = 0; |