version 1.43, 2004/09/14 22:24:24 |
version 1.44, 2005/04/11 07:04:47 |
|
|
} |
} |
} |
} |
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 && |
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 && |
ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 && |
ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 && |
ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) || ws.ws_col == 0) |
ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) || ws.ws_col == 0) |
ttywidth = 79; |
ttywidth = 79; |
else |
else |
ttywidth = ws.ws_col - 1; |
ttywidth = ws.ws_col - 1; |
argwidth = ttywidth - WUSED; |
argwidth = ttywidth - WUSED; |
if (argwidth < 4) |
if (argwidth < 4) |
argwidth = 8; |
argwidth = 8; |
/* sort by idle time */ |
/* sort by idle time */ |
if (sortidle && ehead != NULL) { |
if (sortidle && ehead != NULL) { |
struct entry *from = ehead, *save; |
struct entry *from = ehead, *save; |
|
|
ehead = NULL; |
ehead = NULL; |
while (from != NULL) { |
while (from != NULL) { |
for (nextp = &ehead; |
for (nextp = &ehead; |
|
|
*nextp = save; |
*nextp = save; |
} |
} |
} |
} |
|
|
if (!nflag) { |
if (!nflag) { |
if (gethostname(domain, sizeof(domain)) < 0 || |
if (gethostname(domain, sizeof(domain)) < 0 || |
(p = strchr(domain, '.')) == 0) |
(p = strchr(domain, '.')) == 0) |