summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/squashfs-tools/files/squashfs-tools-4.2_p20140119-progress-stderr.patch')
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.2_p20140119-progress-stderr.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.2_p20140119-progress-stderr.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.2_p20140119-progress-stderr.patch
new file mode 100644
index 00000000..5ab05bda
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.2_p20140119-progress-stderr.patch
@@ -0,0 +1,60 @@
+--- progressbar.c.bak/progressbar.c.bak
++++ progressbar.c.bak/progressbar.c
+@@ -56,8 +56,8 @@
+ {
+ struct winsize winsize;
+
+- if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
+- if(isatty(STDOUT_FILENO))
++ if(ioctl(2, TIOCGWINSZ, &winsize) == -1) {
++ if(isatty(STDERR_FILENO))
+ ERROR("TIOCGWINSZ ioctl failed, defaulting to 80 "
+ "columns\n");
+ columns = 80;
+@@ -108,7 +108,7 @@
+ return;
+
+ if(tty == -1)
+- tty = isatty(STDOUT_FILENO);
++ tty = isatty(STDERR_FILENO);
+ if(!tty) {
+ static long long previous = -1;
+
+@@ -122,19 +122,19 @@
+ previous = current;
+ }
+
+- printf("\r[");
++ fprintf(stderr, "\r[");
+
+ while (hashes --)
+- putchar('=');
++ putc('=', stderr);
+
+- putchar(rotate_list[rotate]);
++ putc(rotate_list[rotate], stderr);
+
+ while(spaces --)
+- putchar(' ');
++ putc(' ', stderr);
+
+- printf("] %*lld/%*lld", max_digits, current, max_digits, max);
+- printf(" %3lld%%", current * 100 / max);
+- fflush(stdout);
++ fprintf(stderr, "] %*lld/%*lld", max_digits, current, max_digits, max);
++ fprintf(stderr, " %3lld%%", current * 100 / max);
++ fflush(stderr);
+ }
+
+
+@@ -180,8 +180,8 @@
+ struct itimerval itimerval;
+ struct winsize winsize;
+
+- if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
+- if(isatty(STDOUT_FILENO))
++ if(ioctl(2, TIOCGWINSZ, &winsize) == -1) {
++ if(isatty(STDERR_FILENO))
+ ERROR("TIOCGWINSZ ioctl failed, defaulting to 80 "
+ "columns\n");
+ columns = 80;