mirror of git://git.suckless.org/ubase
Print system login processes correctly when doing who -l
Fix style as well.
This commit is contained in:
parent
9031fcfd29
commit
07592f31be
5
who.c
5
who.c
|
@ -49,9 +49,9 @@ main(int argc, char **argv)
|
||||||
if (!*usr.ut_name || !*usr.ut_line ||
|
if (!*usr.ut_name || !*usr.ut_line ||
|
||||||
usr.ut_line[0] == '~')
|
usr.ut_line[0] == '~')
|
||||||
continue;
|
continue;
|
||||||
if (mflag && strcmp(usr.ut_line, tty))
|
if (mflag != 0 && strcmp(usr.ut_line, tty) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (strcmp(usr.ut_name, "LOGIN") == lflag)
|
if (!!strcmp(usr.ut_name, "LOGIN") == lflag)
|
||||||
continue;
|
continue;
|
||||||
t = usr.ut_time;
|
t = usr.ut_time;
|
||||||
strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime(&t));
|
strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime(&t));
|
||||||
|
@ -60,4 +60,3 @@ main(int argc, char **argv)
|
||||||
fclose(ufp);
|
fclose(ufp);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue