| 1 |
Description: w: print idletime if there is a tty |
| 2 |
w would try to stat() the tty device, which could be a problem |
| 3 |
if there isn't one defined for a user. |
| 4 |
Author: Werner Fink <[email protected]> |
| 5 |
Origin: upstream, https://gitlab.com/procps-ng/procps/-/commit/214a8421f8c81668c96ee489781a2b104f56e7e1 |
| 6 |
Applied-Upstream: 4.0.5 |
| 7 |
Last-Update: 2025-04-14 |
| 8 |
--- |
| 9 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 10 |
--- a/src/w.c |
| 11 |
+++ b/src/w.c |
| 12 |
@@ -612,8 +612,10 @@ |
| 13 |
if (u && *u->ut_line == ':') |
| 14 |
/* idle unknown for xdm logins */ |
| 15 |
printf(" ?xdm? "); |
| 16 |
- else |
| 17 |
+ else if (tty[5]) |
| 18 |
print_time_ival7(idletime(tty), 0, stdout); |
| 19 |
+ else |
| 20 |
+ printf(" "); |
| 21 |
|
| 22 |
/* jpcpu/pcpu */ |
| 23 |
if (longform) { |