# HG changeset patch # User Matt Johnston # Date 1301582531 0 # Node ID 306a907d23e7dce13ff7b130d2aeb3655da163fd # Parent 4fbf9a7556edb725cf59b6b62b4c38ee458e7d9c Avoid segfault when handling childpid race diff -r 4fbf9a7556ed -r 306a907d23e7 svr-chansession.c --- a/svr-chansession.c Fri Mar 18 14:31:07 2011 +0000 +++ b/svr-chansession.c Thu Mar 31 14:42:11 2011 +0000 @@ -692,6 +692,8 @@ ses.maxfd = MAX(ses.maxfd, channel->readfd); ses.maxfd = MAX(ses.maxfd, channel->errfd); + sleep(1); + addchildpid(chansess, chansess->pid); if (svr_ses.lastexit.exitpid != -1) { @@ -705,6 +707,7 @@ TRACE(("found match for lastexitpid")) svr_ses.childpids[i].chansess->exit = svr_ses.lastexit; svr_ses.lastexit.exitpid = -1; + break; } } }