4.3BSD "who" improvements
Doug Gwyn
gwyn at brl-smoke.ARPA
Mon Mar 16 13:24:09 AEST 1987
65a66,67
+ if (argc == 3) /* DAG -- efficiency tweak (moved out of loop) */
+ gethostname(hostname, sizeof (hostname));
68d69
- gethostname(hostname, sizeof (hostname));
78a80,90
+ if (argc == 3) { /* DAG -- added to handle empty utmp slots */
+ /* not in utmp - use best guess from passwd file */
+ pw = getpwuid(getuid());
+ strncpy(utmp.ut_name, pw ? pw->pw_name : "?", NMAX);
+ strncpy(utmp.ut_line, tp, LMAX);
+ strncpy(utmp.ut_host, "null", HMAX);
+ time(&utmp.ut_time);
+ printf("%s!", hostname);
+ putline();
+ }
+ exit(0); /* DAG -- bug fix (was missing) */
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list