[glib: 8/11] Fix global variable name hidden by local variables in gio/tests/socket-server.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 8/11] Fix global variable name hidden by local variables in gio/tests/socket-server.c
- Date: Fri, 1 Apr 2022 15:13:33 +0000 (UTC)
commit 027e3769eea2a605afdf0bbd5f7cabcf81164336
Author: Loic Le Page <llepage fluendo com>
Date: Wed Jan 19 14:45:49 2022 +0100
Fix global variable name hidden by local variables in gio/tests/socket-server.c
gio/tests/socket-server.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/tests/socket-server.c b/gio/tests/socket-server.c
index 8b0d2a9257..61715b02d0 100644
--- a/gio/tests/socket-server.c
+++ b/gio/tests/socket-server.c
@@ -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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]