]> err.no Git - systemd/commitdiff
util: look at STDOUT, not STDIN, when determining tty columns
authorLennart Poettering <lennart@poettering.net>
Tue, 31 Aug 2010 14:53:58 +0000 (16:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 31 Aug 2010 14:53:58 +0000 (16:53 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=626891

src/util.c

index a09b704ffebd1e2195a17b6b4a95fdab717afdb2..f982586cee9b1d2c1939e8b7f8d4ecd13a3e5e81 100644 (file)
@@ -2988,7 +2988,7 @@ int columns(void) {
                 struct winsize ws;
                 zero(ws);
 
-                if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
+                if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
                         parsed_columns = ws.ws_col;
         }