aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-20 08:47:06 +0200
committerMax Kellermann <max@duempel.org>2011-09-20 08:47:06 +0200
commit921553d7bb38345ba99c069fa1ee7816d5130c9b (patch)
tree879a0384b9a4bc93e9b3c3c476812c660b7e63b4 /src/output
parent27946a981ff4192f064feb3117567463c137933f (diff)
parentc476819cb1186770b1b7395851e394caac39cbc8 (diff)
downloadmpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.tar.gz
mpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.tar.xz
mpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.zip
Merge branch 'v0.16.x'
Diffstat (limited to 'src/output')
-rw-r--r--src/output/httpd_client.c7
-rw-r--r--src/output/httpd_output_plugin.c4
-rw-r--r--src/output/solaris_output_plugin.c20
3 files changed, 23 insertions, 8 deletions
diff --git a/src/output/httpd_client.c b/src/output/httpd_client.c
index e2c49c6c8..7a50f6fe6 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 <stdbool.h>
#include <assert.h>
@@ -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);
diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c
index ab663badf..8ef0c11a6 100644
--- a/src/output/httpd_output_plugin.c
+++ b/src/output/httpd_output_plugin.c
@@ -214,7 +214,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;
}
@@ -235,7 +235,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));
}
diff --git a/src/output/solaris_output_plugin.c b/src/output/solaris_output_plugin.c
index 796c7806d..ce726009a 100644
--- a/src/output/solaris_output_plugin.c
+++ b/src/output/solaris_output_plugin.c
@@ -24,7 +24,6 @@
#include <glib.h>
-#include <sys/audio.h>
#include <sys/stropts.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -32,6 +31,25 @@
#include <fcntl.h>
#include <errno.h>
+#ifdef __sun
+#include <sys/audio.h>
+#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"