From 1d8840412fc1dd76a73ee13413cd7fc9a6ff229a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 19 Sep 2011 07:39:27 +0200 Subject: configure.ac: add option --enable-solaris-output Allow enabling the plugin explicitly without running Solaris, to test the build. --- src/output/solaris_output_plugin.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/output') diff --git a/src/output/solaris_output_plugin.c b/src/output/solaris_output_plugin.c index 22c583805..6f6f507b3 100644 --- a/src/output/solaris_output_plugin.c +++ b/src/output/solaris_output_plugin.c @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -31,6 +30,25 @@ #include #include +#ifdef __sun +#include +#else + +/* some fake declarations that allow build this plugin on systems + other than Solaris, just to see if it compiles */ + +#define AUDIO_GETINFO 0 +#define AUDIO_SETINFO 0 +#define AUDIO_ENCODING_LINEAR 0 + +struct audio_info { + struct { + unsigned sample_rate, channels, precision, encoding; + } play; +}; + +#endif + #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "solaris_output" -- cgit v1.2.3 From b03f9ece05c6f9a6410da48ec024f9d6bed0dc82 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 19 Sep 2011 20:40:33 +0200 Subject: glib_socket.h: wrap g_io_channel_*_new() calls portably The server_socket library (used by the httpd output plugin) didn't check for WIN32, that's fixed now. --- src/output/httpd_client.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/output') diff --git a/src/output/httpd_client.c b/src/output/httpd_client.c index 1119a7834..995c1f659 100644 --- a/src/output/httpd_client.c +++ b/src/output/httpd_client.c @@ -24,6 +24,7 @@ #include "page.h" #include "icy_server.h" #include "glib_compat.h" +#include "glib_socket.h" #include #include @@ -459,11 +460,7 @@ httpd_client_new(struct httpd_output *httpd, int fd, bool metadata_supported) client->httpd = httpd; -#ifndef G_OS_WIN32 - client->channel = g_io_channel_unix_new(fd); -#else - client->channel = g_io_channel_win32_new_socket(fd); -#endif + client->channel = g_io_channel_new_socket(fd); /* GLib is responsible for closing the file descriptor */ g_io_channel_set_close_on_unref(client->channel, true); -- cgit v1.2.3 From c476819cb1186770b1b7395851e394caac39cbc8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 19 Sep 2011 21:04:19 +0200 Subject: fd_util: add function close_socket() Wrap close(), use closesocket() on WIN32/WinSock. --- src/output/httpd_output_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/output') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index 40ad05c3d..2c140a300 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -201,7 +201,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address, g_warning("libwrap refused connection (libwrap=%s) from %s", progname, hostaddr); g_free(hostaddr); - close(fd); + close_socket(fd); g_mutex_unlock(httpd->mutex); return; } @@ -222,7 +222,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address, httpd->clients_cnt < httpd->clients_max)) httpd_client_add(httpd, fd); else - close(fd); + close_socket(fd); } else if (fd < 0 && errno != EINTR) { g_warning("accept() failed: %s", g_strerror(errno)); } -- cgit v1.2.3