From 894a190f06c523b09830c56eed1289482180ac24 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sat, 11 Aug 2012 17:13:43 -0400 Subject: [PATCH] Revert creation of utmp entry to avoid uninitialized "master" --- src/frontend/mosh-server.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 9aa69d4..1b42aa0 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -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 ) {