aboutsummaryrefslogtreecommitdiffstats
path: root/src/event_pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event_pipe.c')
-rw-r--r--src/event_pipe.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/event_pipe.c b/src/event_pipe.c
index 3e5009150..f66dc86d6 100644
--- a/src/event_pipe.c
+++ b/src/event_pipe.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2009 The Music Player Daemon Project
+ * Copyright (C) 2003-2010 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "config.h"
#include "event_pipe.h"
-#include "utils.h"
+#include "fd_util.h"
#include <stdbool.h>
#include <assert.h>
@@ -84,17 +85,9 @@ void event_pipe_init(void)
GIOChannel *channel;
int ret;
-#ifdef WIN32
- ret = _pipe(event_pipe, 512, _O_BINARY);
-#else
- ret = pipe(event_pipe);
-#endif
+ ret = pipe_cloexec_nonblock(event_pipe);
if (ret < 0)
g_error("Couldn't open pipe: %s", strerror(errno));
-#ifndef WIN32
- if (set_nonblocking(event_pipe[1]) < 0)
- g_error("Couldn't set non-blocking I/O: %s", strerror(errno));
-#endif
channel = g_io_channel_unix_new(event_pipe[0]);
event_pipe_source_id = g_io_add_watch(channel, G_IO_IN,