Better error handling for remotes

This commit is contained in:
Alex Young
2012-07-16 11:04:45 +01:00
parent 9a81af5f8f
commit db30ea0c48

View File

@@ -15,12 +15,13 @@ void print_response( const char * response )
NULLCHECK( response ); NULLCHECK( response );
exit_status = atoi(response); exit_status = atoi(response);
response_text = strchr( response, ':' ) + 2; response_text = strchr( response, ':' );
NULLCHECK( response_text ); FATAL_IF_NULL( response_text,
"Error parsing server response: '%s'", response );
out = exit_status > 0 ? stderr : stdout; out = exit_status > 0 ? stderr : stdout;
fprintf(out, "%s\n", response_text ); fprintf(out, "%s\n", response_text + 2);
} }
void do_remote_command(char* command, char* socket_name, int argc, char** argv) void do_remote_command(char* command, char* socket_name, int argc, char** argv)