Revert creation of utmp entry to avoid uninitialized "master"

This commit is contained in:
Keith Winstein
2012-08-11 17:13:43 -04:00
parent 7989d381cf
commit 894a190f06
+5 -5
View File
@@ -400,12 +400,7 @@ int run_server( const char *desired_ip, const char *desired_port,
} }
char utmp_entry[ 64 ] = { 0 }; char utmp_entry[ 64 ] = { 0 };
#ifdef HAVE_UTEMPTER
/* make utmp entry */
snprintf( utmp_entry, 64, "mosh [%d]", getpid() ); snprintf( utmp_entry, 64, "mosh [%d]", getpid() );
utempter_add_record( master, utmp_entry );
#endif
/* Fork child process */ /* Fork child process */
pid_t child = forkpty( &master, NULL, &child_termios, &window_size ); pid_t child = forkpty( &master, NULL, &child_termios, &window_size );
@@ -471,6 +466,11 @@ int run_server( const char *desired_ip, const char *desired_port,
} else { } else {
/* parent */ /* parent */
#ifdef HAVE_UTEMPTER
/* make utmp entry */
utempter_add_record( master, utmp_entry );
#endif
try { try {
serve( master, terminal, *network ); serve( master, terminal, *network );
} catch ( const Network::NetworkException& e ) { } catch ( const Network::NetworkException& e ) {