diff options
| author | Karel Zak <kzak@redhat.com> | 2006-12-07 00:26:00 +0100 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2006-12-07 00:26:00 +0100 |
| commit | f0c8eda12c410fb56630de47f6d50cac15f7529a (patch) | |
| tree | 4531e56b1873ce6b4e5db4bf4684f5daa4e1257e /login-utils | |
| parent | 63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (diff) | |
| download | util-linux-old-f0c8eda12c410fb56630de47f6d50cac15f7529a.tar.gz | |
Imported from util-linux-2.11u tarball.
Diffstat (limited to 'login-utils')
| -rw-r--r-- | login-utils/agetty.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/login-utils/agetty.c b/login-utils/agetty.c index d53811b2..f9f33b53 100644 --- a/login-utils/agetty.c +++ b/login-utils/agetty.c @@ -572,9 +572,16 @@ update_utmp(line) utmpname(_PATH_UTMP); setutent(); - while ((utp = getutent()) - && !(utp->ut_type == INIT_PROCESS - && utp->ut_pid == mypid)) /* nothing */; + + /* Find mypid in utmp. Earlier code here tested only + utp->ut_type != INIT_PROCESS, so maybe the >= here should be >. + The present code is taken from login.c, so if this is changed, + maybe login has to be changed as well. */ + while ((utp = getutent())) + if (utp->ut_pid == mypid + && utp->ut_type >= INIT_PROCESS + && utp->ut_type <= DEAD_PROCESS) + break; if (utp) { memcpy(&ut, utp, sizeof(ut)); |
