Just die if ttyname() fails
This commit is contained in:
parent
2832db2368
commit
53547b7835
2
login.c
2
login.c
@ -81,7 +81,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
tty = ttyname(STDIN_FILENO);
|
tty = ttyname(STDIN_FILENO);
|
||||||
if (!tty)
|
if (!tty)
|
||||||
tty = "?";
|
eprintf("ttyname:");
|
||||||
usr.ut_type = USER_PROCESS;
|
usr.ut_type = USER_PROCESS;
|
||||||
usr.ut_pid = getpid();
|
usr.ut_pid = getpid();
|
||||||
strlcpy(usr.ut_user, argv[0], sizeof(usr.ut_user));
|
strlcpy(usr.ut_user, argv[0], sizeof(usr.ut_user));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user