summaryrefslogtreecommitdiff
path: root/progress.c
diff options
context:
space:
mode:
Diffstat (limited to 'progress.c')
-rw-r--r--progress.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/progress.c b/progress.c
index 43d9228378..2e31bec60f 100644
--- a/progress.c
+++ b/progress.c
@@ -74,7 +74,8 @@ static void clear_progress_signal(void)
static int is_foreground_fd(int fd)
{
- return getpgid(0) == tcgetpgrp(fd);
+ int tpgrp = tcgetpgrp(fd);
+ return tpgrp < 0 || tpgrp == getpgid(0);
}
static int display(struct progress *progress, unsigned n, const char *done)