Fix stop signal logic broken by the killswitch

This commit is contained in:
nick
2014-01-22 12:16:09 +00:00
parent dcead04cf6
commit afcc07a181
2 changed files with 3 additions and 3 deletions

View File

@@ -567,7 +567,7 @@ int client_serve_request(struct client* client)
if ( self_pipe_fd_isset( client->stop_signal, &fds ) ){ if ( self_pipe_fd_isset( client->stop_signal, &fds ) ){
debug("Client received stop signal."); debug("Client received stop signal.");
return 0; return 1; // Don't try to serve more requests
} }

View File

@@ -76,8 +76,8 @@ START_TEST( test_read_request_quits_on_stop_signal )
client_signal_stop( c ); client_signal_stop( c );
int client_read_request( struct client *, struct nbd_request *); int client_serve_request( struct client *);
fail_unless( 0 == client_read_request( c, &nbdr ), "Didn't quit on stop." ); fail_unless( 1 == client_serve_request( c ), "Didn't quit on stop." );
close( fds[0] ); close( fds[0] );
close( fds[1] ); close( fds[1] );