Lines 95-101
static struct utmpx *utmp;
Link Here
|
95 |
static struct winsize ws; |
95 |
static struct winsize ws; |
96 |
static kvm_t *kd; |
96 |
static kvm_t *kd; |
97 |
static time_t now; /* the current time of day */ |
97 |
static time_t now; /* the current time of day */ |
98 |
static int ttywidth; /* width of tty */ |
|
|
99 |
static int fromwidth = 0; /* max width of "from" field */ |
98 |
static int fromwidth = 0; /* max width of "from" field */ |
100 |
static int argwidth; /* width of arguments */ |
99 |
static int argwidth; /* width of arguments */ |
101 |
static int header = 1; /* true if -h flag: don't print heading */ |
100 |
static int header = 1; /* true if -h flag: don't print heading */ |
Lines 381-393
main(int argc, char *argv[])
Link Here
|
381 |
} |
380 |
} |
382 |
} |
381 |
} |
383 |
} |
382 |
} |
384 |
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 && |
383 |
/* Don't truncate the argument list if --libxo was specified */ |
385 |
ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 && |
384 |
if (xo_libxo_set()) { |
386 |
ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) || ws.ws_col == 0) |
385 |
argwidth = ARG_MAX; |
387 |
ttywidth = 79; |
386 |
} else { |
388 |
else |
387 |
int ttywidth; /* width of tty */ |
389 |
ttywidth = ws.ws_col - 1; |
388 |
|
390 |
argwidth = ttywidth - WUSED; |
389 |
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 && |
|
|
390 |
ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 && |
391 |
ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) || |
392 |
ws.ws_col == 0) |
393 |
ttywidth = 79; |
394 |
else |
395 |
ttywidth = ws.ws_col - 1; |
396 |
argwidth = ttywidth - WUSED; |
397 |
} |
391 |
if (argwidth < 4) |
398 |
if (argwidth < 4) |
392 |
argwidth = 8; |
399 |
argwidth = 8; |
393 |
for (ep = ehead; ep != NULL; ep = ep->next) { |
400 |
for (ep = ehead; ep != NULL; ep = ep->next) { |