Revert creation of utmp entry to avoid uninitialized "master"
This commit is contained in:
@@ -400,12 +400,7 @@ int run_server( const char *desired_ip, const char *desired_port,
|
||||
}
|
||||
|
||||
char utmp_entry[ 64 ] = { 0 };
|
||||
|
||||
#ifdef HAVE_UTEMPTER
|
||||
/* make utmp entry */
|
||||
snprintf( utmp_entry, 64, "mosh [%d]", getpid() );
|
||||
utempter_add_record( master, utmp_entry );
|
||||
#endif
|
||||
|
||||
/* Fork child process */
|
||||
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 {
|
||||
/* parent */
|
||||
|
||||
#ifdef HAVE_UTEMPTER
|
||||
/* make utmp entry */
|
||||
utempter_add_record( master, utmp_entry );
|
||||
#endif
|
||||
|
||||
try {
|
||||
serve( master, terminal, *network );
|
||||
} catch ( const Network::NetworkException& e ) {
|
||||
|
||||
Reference in New Issue
Block a user