mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
Fix global variable name hidden by local variables in gio/tests/socket-server.c
This commit is contained in:
parent
7178e10cd5
commit
027e3769ee
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
|
|
||||||
int port = 7777;
|
int default_port = 7777;
|
||||||
gboolean verbose = FALSE;
|
gboolean verbose = FALSE;
|
||||||
gboolean dont_reuse_address = FALSE;
|
gboolean dont_reuse_address = FALSE;
|
||||||
gboolean non_blocking = FALSE;
|
gboolean non_blocking = FALSE;
|
||||||
@ -18,7 +18,7 @@ gboolean unix_socket = FALSE;
|
|||||||
const char *tls_cert_file = NULL;
|
const char *tls_cert_file = NULL;
|
||||||
|
|
||||||
static GOptionEntry cmd_entries[] = {
|
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},
|
"Local port to bind to", NULL},
|
||||||
{"cancel", 'c', 0, G_OPTION_ARG_INT, &cancel_timeout,
|
{"cancel", 'c', 0, G_OPTION_ARG_INT, &cancel_timeout,
|
||||||
"Cancel any op after the specified amount of seconds", NULL},
|
"Cancel any op after the specified amount of seconds", NULL},
|
||||||
@ -51,7 +51,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
GSocket *socket, *new_socket, *recv_socket;
|
GSocket *socket, *new_socket, *recv_socket;
|
||||||
GSocketAddress *src_address;
|
GSocketAddress *src_address;
|
||||||
GSocketAddress *address;
|
GSocketAddress *address = NULL;
|
||||||
GSocketType socket_type;
|
GSocketType socket_type;
|
||||||
GSocketFamily socket_family;
|
GSocketFamily socket_family;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@ -140,7 +140,7 @@ main (int argc,
|
|||||||
}
|
}
|
||||||
else
|
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))
|
if (!g_socket_bind (socket, src_address, !dont_reuse_address, &error))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user