Commits

Anonymous committed 67beb39

do size based on stderr, because we might pipe stdout to something else

Comments (0)

Files changed (1)

 #include <sys/select.h>
 #include <sys/inotify.h>
 
+#define STDIN  0
 #define STDOUT 1
+#define STDERR 2
 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
 
 FILE *in, *out;
 {
 	rewind(in);
 
-	if (ioctl(STDOUT, TIOCGWINSZ, &ws) < 0)
-		err(1, "failed ioctl");
+	if (ioctl(STDERR, TIOCGWINSZ, &ws) < 0)
+		warn("failed ioctl");
 
 	while (fgets(buf, sizeof(buf), in))
 		print_line(buf);