+Mon Aug 7 18:29:21 1995 Sam Hartman <hartmans@tertius.mit.edu>
+
+ * sys_term.c: Use new interface to pty_update_utmp.
+ (getptyslave): Handle error return from pty_open_slave
+ Close syncpipe[1] before we read from it.
Mon Aug 7 14:44:21 EDT 1995 Paul Park (pjpark@mit.edu)
* configure.in, sys_term.c - Use utmpx.h if present, then check for
waslm = tty_linemode();
# endif
- if ( (retval = pty_open_slave (line, &t)) < 0 )
+ if ( (retval = pty_open_slave (line, &t)) != 0 )
{
- com_err(retval, "telnetd", "while opening slave terminal");
- fatalperror(net, line);
+ fatalperror(net, error_message(retval));
}
#ifdef STREAMSPTY
#endif
/* Wait for child before writing to parent side of pty.*/
+(void) close(syncpipe[1]);
read(syncpipe[0], &c, 1);
close(syncpipe[0]);
- close(syncpipe[1]);
+
} else {
- /*
- * Create utmp entry for child
- */
-#ifdef UTMPX
- (void) time(&wtmp.ut_tv.tv_sec);
- wtmp.ut_tv.tv_usec = 0;
-#else /* UTMPX */
- (void) time(&wtmp.ut_time);
-#endif /* UTMPX */
- wtmp.ut_type = LOGIN_PROCESS;
- wtmp.ut_pid = getpid();
-
-
-pty_update_utmp (&wtmp, "LOGIN", line, host);
+
+ pty_update_utmp (PTY_LOGIN_PROCESS, getpid(), "LOGIN", line, host);
getptyslave(autologin);
/* Notify our parent we're ready to continue.*/