Fix bug affecting clean shutdown on OS X

This commit is contained in:
Keith Winstein
2012-03-07 03:21:33 -05:00
parent 4295111fd9
commit 4e158a22e5
+4
View File
@@ -349,7 +349,11 @@ void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &network
/* fill buffer if possible */ /* fill buffer if possible */
ssize_t bytes_read = read( pollfds[ 1 ].fd, buf, buf_size ); ssize_t bytes_read = read( pollfds[ 1 ].fd, buf, buf_size );
if ( bytes_read == 0 ) { /* EOF */ if ( bytes_read == 0 ) { /* EOF */
if ( !network.has_remote_addr() ) {
return; return;
} else if ( !network.shutdown_in_progress() ) {
network.start_shutdown();
}
} else if ( bytes_read < 0 ) { } else if ( bytes_read < 0 ) {
perror( "read" ); perror( "read" );
return; return;