summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-18 09:28:11 +1100
committerDamien Miller <djm@mindrot.org>1999-11-18 09:28:11 +1100
commit81428f9d10e81d9fe2e4af10df0c4e38d1192d70 (patch)
treeb19982baa6558d387f3537ef67d64a5f6a38ebd0 /scp.c
parent10f6f6ba9ee14d306f8780edee8a10640c1643e0 (diff)
- 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.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/scp.c b/scp.c
index 2850f76f..e156f7ba 100644
--- a/scp.c
+++ b/scp.c
@@ -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;