Daniel P. Berrangé <berra...@redhat.com> writes: > On Thu, Oct 29, 2020 at 02:38:25PM +0100, Markus Armbruster wrote: >> The thread functions build the SocketAddress from global variable >> @abstract_sock_name and the tight flag passed as pointer >> argument (either NULL or (gpointer)1). There is no need for such >> hackery; simply pass the SocketAddress instead. >> >> While there, dumb down g_rand_int_range() to g_random_int(). >> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- >> tests/test-util-sockets.c | 62 +++++++++++++++------------------------ >> 1 file changed, 24 insertions(+), 38 deletions(-) >> >> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c >> index 9d317e73a6..b1b5628bd5 100644 >> --- a/tests/test-util-sockets.c >> +++ b/tests/test-util-sockets.c >> @@ -230,25 +230,14 @@ static void test_socket_fd_pass_num_nocli(void) >> #endif >> >> #ifdef __linux__ >> -static gchar *abstract_sock_name; >> - >> static gpointer unix_server_thread_func(gpointer user_data) >> { >> - SocketAddress addr; > > Keep this but as a pointer, and initialize it to "user_data", > so that it is clear what data type this parameter is expected > to be.
Can do (I don't care for it myself). [...]