aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-16 14:15:12 +0100
committerThomas White <taw@physics.org>2010-03-16 14:15:12 +0100
commit353a4224b3951be76bbc19bc043d24bfaf0590f6 (patch)
treeb3f61db678adc1453a84ab7068651825b377ba55
parent4955cf7f602bf300a348a1342dad6840020483c3 (diff)
Fix TTY detection
-rw-r--r--src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index 6abe6237..70fd1453 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -12,6 +12,7 @@
#include <math.h>
#include <string.h>
#include <stdio.h>
+#include <unistd.h>
#include "utils.h"
#include "image.h"
@@ -51,7 +52,7 @@ void progress_bar(int val, int total, const char *text)
char s[1024];
const int width = 50;
- if ( !isatty(stderr) ) return;
+ if ( !isatty(fileno(stderr)) ) return;
frac = (double)val/total;
n = (int)(frac*width);