diff --git a/gio/tests/unix-streams.c b/gio/tests/unix-streams.c index 5ec829919..407a67dbd 100644 --- a/gio/tests/unix-streams.c +++ b/gio/tests/unix-streams.c @@ -474,8 +474,9 @@ test_write_wouldblock (void) gint fd[2]; GError *err = NULL; guint8 data_write[1024], data_read[1024]; - guint i; - gint pipe_capacity; + gsize i; + int retval; + gsize pipe_capacity; for (i = 0; i < sizeof (data_write); i++) data_write[i] = i; @@ -483,7 +484,9 @@ test_write_wouldblock (void) g_assert_cmpint (pipe (fd), ==, 0); g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0); - pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL); + retval = fcntl (fd[0], F_GETPIPE_SZ); + g_assert_cmpint (retval, >=, 0); + pipe_capacity = (gsize) retval; g_assert_cmpint (pipe_capacity, >=, 4096); g_assert_cmpint (pipe_capacity % 1024, >=, 0); @@ -552,10 +555,11 @@ test_writev_wouldblock (void) gint fd[2]; GError *err = NULL; guint8 data_write[1024], data_read[1024]; - guint i; + gsize i; + int retval; + gsize pipe_capacity; GOutputVector vectors[4]; GPollableReturn res; - gint pipe_capacity; for (i = 0; i < sizeof (data_write); i++) data_write[i] = i; @@ -563,7 +567,9 @@ test_writev_wouldblock (void) g_assert_cmpint (pipe (fd), ==, 0); g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0); - pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL); + retval = fcntl (fd[0], F_GETPIPE_SZ); + g_assert_cmpint (retval, >=, 0); + pipe_capacity = (gsize) retval; g_assert_cmpint (pipe_capacity, >=, 4096); g_assert_cmpint (pipe_capacity % 1024, >=, 0); @@ -667,8 +673,9 @@ test_write_async_wouldblock (void) GUnixOutputStream *os; gint fd[2]; guint8 *data, *data_read; - guint i; - gint pipe_capacity; + gsize i; + int retval; + gsize pipe_capacity; gsize bytes_written = 0, bytes_read = 0; g_assert_cmpint (pipe (fd), ==, 0); @@ -685,7 +692,9 @@ test_write_async_wouldblock (void) g_unix_set_fd_nonblocking (fd[1], TRUE, NULL); g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0); - pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL); + retval = fcntl (fd[0], F_GETPIPE_SZ); + g_assert_cmpint (retval, >=, 0); + pipe_capacity = (gsize) retval; g_assert_cmpint (pipe_capacity, >=, 4096); data = g_new (guint8, 4 * pipe_capacity); @@ -754,8 +763,9 @@ test_writev_async_wouldblock (void) GUnixOutputStream *os; gint fd[2]; guint8 *data, *data_read; - guint i; - gint pipe_capacity; + gsize i; + int retval; + gsize pipe_capacity; gsize bytes_written = 0, bytes_read = 0; GOutputVector vectors[4]; @@ -773,7 +783,9 @@ test_writev_async_wouldblock (void) g_unix_set_fd_nonblocking (fd[1], TRUE, NULL); g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0); - pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL); + retval = fcntl (fd[0], F_GETPIPE_SZ); + g_assert_cmpint (retval, >=, 0); + pipe_capacity = (gsize) retval; g_assert_cmpint (pipe_capacity, >=, 4096); data = g_new (guint8, 4 * pipe_capacity);