+Tue Aug 8 11:26:54 1995 Sam Hartman <hartmans@pao.mit.edu>
+
+ * sys_term.c: Fail if the slave side dies.
+ (dup_tty): Renamed from login_tty because OSF already has that function and it isn't compatible.
+
+ (getptyslave): Fix argument to fatalperror by including com_err.h instead of casting.
Tue Aug 8 17:25:22 EDT 1995 Paul Park (pjpark@mit.edu)
* sys_term.c - Cast argument to fatalperror().
-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
#include "telnetd.h"
#include "pathnames.h"
+#include <com_err.h>
#ifndef LOGIN_PROGRAM
#define LOGIN_PROGRAM _PATH_LOGIN
if ( (retval = pty_open_slave (line, &t)) != 0 )
{
- fatalperror(net, (char *) error_message(retval));
+ fatalperror(net, error_message(retval));
}
#ifdef STREAMSPTY
* Set the tty modes, and make this our controlling tty.
*/
set_termbuf();
- if (login_tty(t) == -1)
- fatalperror(net, "login_tty");
+ if (dup_tty(t) == -1)
+ fatalperror(net, "dup_tty");
#endif /* !defined(CRAY) || !defined(NEWINIT) */
if (net > 2)
(void) close(net);
#endif /* !defined(CRAY) || !defined(NEWINIT) */
-#if BSD <= 43
+
int
-login_tty(t)
+dup_tty(t)
int t;
{
if (t != 0)
close(t);
return(0);
}
-#endif /* BSD <= 43 */
+
#ifdef NEWINIT
char *gen_id = "fe";
/* Wait for child before writing to parent side of pty.*/
(void) close(syncpipe[1]);
- read(syncpipe[0], &c, 1);
+if ( read(syncpipe[0], &c, 1) == 0 ) {
+ /* Slave side died */
+ fatal ( net, "Slave failed to initialize");
+}
+
close(syncpipe[0]);