Mail Archives: cygwin-developers/1998/05/02/09:22:19
tty.cc (create_tty_master): Fill in ut_host utmp field with local host name
instead of "local" to avoid "who" command timeouts.
Index: tty.cc
===================================================================
RCS file: /usr/cvsroot/cdk/winsup/tty.cc,v
retrieving revision 1.9
diff -u -p -r1.9 tty.cc
--- tty.cc 1998/04/23 16:33:54 1.9
+++ tty.cc 1998/05/02 15:58:48
@@ -281,7 +281,7 @@ create_tty_master (int ttynum)
bzero ((char *) &our_utmp, sizeof (utmp));
(void) time (&our_utmp.ut_time);
strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name));
- strncpy (our_utmp.ut_host, "local", sizeof (our_utmp.ut_host));
+ gethostname (our_utmp.ut_host, sizeof (our_utmp.ut_host));
sprintf (our_utmp.ut_line, "tty%d", ttynum);
our_utmp.ut_type = USER_PROCESS;
myself->ctty = ttynum;
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
- Raw text -