Fix global variable name hidden by local variables in gio/tests/socket-server.c

This commit is contained in:
Loic Le Page 2022-01-19 14:45:49 +01:00 committed by Loïc Le Page
parent 7178e10cd5
commit 027e3769ee

View File

@ -6,7 +6,7 @@
GMainLoop *loop;
int port = 7777;
int default_port = 7777;
gboolean verbose = FALSE;
gboolean dont_reuse_address = FALSE;
gboolean non_blocking = FALSE;
@ -18,7 +18,7 @@ gboolean unix_socket = FALSE;
const char *tls_cert_file = NULL;
static GOptionEntry cmd_entries[] = {
{"port", 'p', 0, G_OPTION_ARG_INT, &port,
{"port", 'p', 0, G_OPTION_ARG_INT, &default_port,
"Local port to bind to", NULL},
{"cancel", 'c', 0, G_OPTION_ARG_INT, &cancel_timeout,
"Cancel any op after the specified amount of seconds", NULL},
@ -51,7 +51,7 @@ main (int argc,
{
GSocket *socket, *new_socket, *recv_socket;
GSocketAddress *src_address;
GSocketAddress *address;
GSocketAddress *address = NULL;
GSocketType socket_type;
GSocketFamily socket_family;
GError *error = NULL;
@ -140,7 +140,7 @@ main (int argc,
}
else
{
src_address = g_inet_socket_address_new (g_inet_address_new_any (G_SOCKET_FAMILY_IPV4), port);
src_address = g_inet_socket_address_new (g_inet_address_new_any (G_SOCKET_FAMILY_IPV4), default_port);
}
if (!g_socket_bind (socket, src_address, !dont_reuse_address, &error))