Package: squashfs-tools
Version: 1:3.3-7
Severity: normal
Tags: patch

Hi,

it doesn't really make sense to display a progress bar if stdout is not
a tty, so check for that.

Cheers,
Julien

--- squashfs-3.3.orig/squashfs-tools/mksquashfs.c
+++ squashfs-3.3/squashfs-tools/mksquashfs.c
@@ -3708,6 +3708,11 @@
 
        block_offset = check_data ? 3 : 2;
 
+       if(progress && !isatty(STDOUT_FILENO)) {
+               printf("standard output is not a tty, disabling progress 
bar\n");
+               progress = FALSE;
+       }
+
        if(progress) {
                if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
                        printf("TIOCGWINZ ioctl failed, defaulting to 80 
columns\n");

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to