aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
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)