"Enable non-blocking i/o", NULL},
{"use-source", 's', 0, G_OPTION_ARG_NONE, &use_source,
"Use GSource to wait for non-blocking i/o", NULL},
+#ifdef G_OS_UNIX
{"unix", 'U', 0, G_OPTION_ARG_NONE, &unix_socket,
"Use a unix socket instead of IP", NULL},
+#endif
{NULL}
};
static char *
socket_address_to_string (GSocketAddress *address)
{
- char *res;
+ char *res = NULL;
if (G_IS_INET_SOCKET_ADDRESS (address))
{
res = g_strdup_printf ("%s:%d", str, port);
g_free (str);
}
+#ifdef G_OS_UNIX
else if (G_IS_UNIX_SOCKET_ADDRESS (address))
{
GUnixSocketAddress *uaddr = G_UNIX_SOCKET_ADDRESS (address);
unix_socket_address_types[g_unix_socket_address_get_address_type (uaddr)],
g_unix_socket_address_get_path (uaddr));
}
+#endif
return res;
}
GSocketAddress *
socket_address_from_string (const char *name)
{
+#ifdef G_OS_UNIX
int i, len;
for (i = 0; i < G_N_ELEMENTS (unix_socket_address_types); i++)
(GUnixSocketAddressType)i);
}
}
+#endif
return NULL;
}
"Enable non-blocking i/o", NULL},
{"use-source", 's', 0, G_OPTION_ARG_NONE, &use_source,
"Use GSource to wait for non-blocking i/o", NULL},
+#ifdef G_OS_UNIX
{"unix", 'U', 0, G_OPTION_ARG_NONE, &unix_socket,
"Use a unix socket instead of IP", NULL},
+#endif
{NULL}
};