aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-09-15 08:33:45 +0000
committerEric Andersen <andersen@codepoet.org>2003-09-15 08:33:45 +0000
commit8efe967018dd79aacfe3ca1e2583f115d744e466 (patch)
tree7590704be6cf03c87242043f5909e12eb4150356 /procps/ps.c
parentc4f72d1426e03f046ac54a00d733a4a52c3a5d4b (diff)
downloadbusybox-8efe967018dd79aacfe3ca1e2583f115d744e466.tar.gz
Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles. -Erik
Diffstat (limited to 'procps/ps.c')
-rw-r--r--procps/ps.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/procps/ps.c b/procps/ps.c
index 9dc45d35d..b9d15b861 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -44,12 +44,7 @@ extern int ps_main(int argc, char **argv)
{
procps_status_t * p;
int i, len;
-#ifdef CONFIG_FEATURE_AUTOWIDTH
- struct winsize win = { 0, 0, 0, 0 };
int terminal_width = TERMINAL_WIDTH;
-#else
-#define terminal_width TERMINAL_WIDTH
-#endif
#ifdef CONFIG_SELINUX
int use_selinux = 0;
@@ -58,12 +53,9 @@ extern int ps_main(int argc, char **argv)
use_selinux = 1;
#endif
-
-#ifdef CONFIG_FEATURE_AUTOWIDTH
- ioctl(fileno(stdout), TIOCGWINSZ, &win);
- if (win.ws_col > 0)
- terminal_width = win.ws_col - 1;
-#endif
+ get_terminal_width_height(0, &terminal_width, NULL);
+ /* Go one less... */
+ terminal_width--;
#ifdef CONFIG_SELINUX
if(use_selinux)