diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-04 23:45:09 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-04 23:45:09 +0200 |
commit | 4c721049c3114c946848fbbd38d6180aa7af537d (patch) | |
tree | 3355d5721cd131e5526caa3a47a517c3586d3ade /loginutils | |
parent | f8fcc184b6e05cbf5f88aa4f4e716e137a69f97e (diff) | |
download | busybox-w32-4c721049c3114c946848fbbd38d6180aa7af537d.tar.gz busybox-w32-4c721049c3114c946848fbbd38d6180aa7af537d.tar.bz2 busybox-w32-4c721049c3114c946848fbbd38d6180aa7af537d.zip |
who: fix attempts to open '/dev/dev/ttyX'; make columns a bit wider, add -H
function old new delta
who_main 292 363 +71
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/login.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index b5e348b66..256c7c475 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -61,7 +61,7 @@ static void read_or_build_utent(struct utmp *utptr, int run_by_root) | |||
61 | 61 | ||
62 | /* First, try to find a valid utmp entry for this process. */ | 62 | /* First, try to find a valid utmp entry for this process. */ |
63 | /* If there is one, just use it. */ | 63 | /* If there is one, just use it. */ |
64 | while ((ut = getutent()) != NULL) | 64 | while ((ut = getutent()) != NULL) { |
65 | if (ut->ut_pid == pid && ut->ut_line[0] && ut->ut_id[0] | 65 | if (ut->ut_pid == pid && ut->ut_line[0] && ut->ut_id[0] |
66 | && (ut->ut_type == LOGIN_PROCESS || ut->ut_type == USER_PROCESS) | 66 | && (ut->ut_type == LOGIN_PROCESS || ut->ut_type == USER_PROCESS) |
67 | ) { | 67 | ) { |
@@ -70,6 +70,7 @@ static void read_or_build_utent(struct utmp *utptr, int run_by_root) | |||
70 | memset(utptr->ut_host, 0, sizeof(utptr->ut_host)); | 70 | memset(utptr->ut_host, 0, sizeof(utptr->ut_host)); |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | } | ||
73 | 74 | ||
74 | // Why? Do we require non-root to exec login from another | 75 | // Why? Do we require non-root to exec login from another |
75 | // former login process (e.g. login shell)? Some login's have | 76 | // former login process (e.g. login shell)? Some login's have |