test: change spawn_stdin_stdout return to void

The return type is changed to avoid having to craft an artificial
`return` just for the Studio compiler.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Andrew Paprocki 2019-03-03 14:45:56 -05:00 committed by cjihrig
parent 7f2d5bc32b
commit 874083d5b3
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
2 changed files with 7 additions and 10 deletions

View File

@ -44,7 +44,7 @@ int ipc_send_recv_helper(void);
int ipc_helper_bind_twice(void);
int ipc_helper_send_zero(void);
int stdio_over_pipes_helper(void);
int spawn_stdin_stdout(void);
void spawn_stdin_stdout(void);
int spawn_tcp_server_helper(void);
static int maybe_run_test(int argc, char **argv);
@ -211,7 +211,8 @@ static int maybe_run_test(int argc, char **argv) {
if (strcmp(argv[1], "spawn_helper9") == 0) {
notify_parent_process();
return spawn_stdin_stdout();
spawn_stdin_stdout();
return 1;
}
#ifndef _WIN32

View File

@ -1838,7 +1838,7 @@ TEST_IMPL(spawn_quoted_path) {
/* Helper for child process of spawn_inherit_streams */
#ifndef _WIN32
int spawn_stdin_stdout(void) {
void spawn_stdin_stdout(void) {
char buf[1024];
char* pbuf;
for (;;) {
@ -1847,7 +1847,7 @@ int spawn_stdin_stdout(void) {
r = read(0, buf, sizeof buf);
} while (r == -1 && errno == EINTR);
if (r == 0) {
return 1;
return;
}
ASSERT(r > 0);
c = r;
@ -1861,12 +1861,9 @@ int spawn_stdin_stdout(void) {
c = c - w;
}
}
#ifndef __SUNPRO_C
return 2;
#endif
}
#else
int spawn_stdin_stdout(void) {
void spawn_stdin_stdout(void) {
char buf[1024];
char* pbuf;
HANDLE h_stdin = GetStdHandle(STD_INPUT_HANDLE);
@ -1879,7 +1876,7 @@ int spawn_stdin_stdout(void) {
DWORD to_write;
if (!ReadFile(h_stdin, buf, sizeof buf, &n_read, NULL)) {
ASSERT(GetLastError() == ERROR_BROKEN_PIPE);
return 1;
return;
}
to_write = n_read;
pbuf = buf;
@ -1889,6 +1886,5 @@ int spawn_stdin_stdout(void) {
pbuf += n_written;
}
}
return 2;
}
#endif /* !_WIN32 */