From 197bbb527256dd4650cc74b9af628ab2d6f1ee21 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Thu, 13 Oct 2011 00:07:52 -0400 Subject: [PATCH] Explicitly close child process on exit --- stm-server.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stm-server.cpp b/stm-server.cpp index 81f3c27..075bfd9 100644 --- a/stm-server.cpp +++ b/stm-server.cpp @@ -92,6 +92,10 @@ int main( void ) } else { /* parent */ serve( master ); + if ( close( master ) < 0 ) { + perror( "close" ); + exit( 1 ); + } } printf( "[stm-server is exiting.]\n" );