aboutsummaryrefslogtreecommitdiffstats
path: root/src/event_pipe.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-01 18:12:14 +0100
committerMax Kellermann <max@duempel.org>2009-01-01 18:12:14 +0100
commit22bb5a5856ff4c195a179610dfb3f09af3183467 (patch)
treeffc7fede9d6208559217a82b7283725bfd114d31 /src/event_pipe.c
parent9f5934d95bac6436ccc9a6dadc57e1e062505a79 (diff)
downloadmpd-22bb5a5856ff4c195a179610dfb3f09af3183467.tar.gz
mpd-22bb5a5856ff4c195a179610dfb3f09af3183467.tar.xz
mpd-22bb5a5856ff4c195a179610dfb3f09af3183467.zip
event_pipe: renamed functions from main_notify_* to event_pipe_*
Continuing the previous patch.
Diffstat (limited to 'src/event_pipe.c')
-rw-r--r--src/event_pipe.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/event_pipe.c b/src/event_pipe.c
index ac76209da..6ae70565e 100644
--- a/src/event_pipe.c
+++ b/src/event_pipe.c
@@ -26,13 +26,13 @@
#include <glib.h>
#include <string.h>
-static int main_pipe[2];
GThread *main_task;
+static int event_pipe[2];
static void consume_pipe(void)
{
char buffer[256];
- ssize_t r = read(main_pipe[0], buffer, sizeof(buffer));
+ ssize_t r = read(event_pipe[0], buffer, sizeof(buffer));
if (r < 0 && errno != EAGAIN && errno != EINTR)
FATAL("error reading from pipe: %s\n", strerror(errno));
@@ -48,38 +48,38 @@ main_notify_event(G_GNUC_UNUSED GIOChannel *source,
return true;
}
-void init_main_notify(void)
+void event_pipe_init(void)
{
GIOChannel *channel;
main_task = g_thread_self();
- if (pipe(main_pipe) < 0)
+ if (pipe(event_pipe) < 0)
g_error("Couldn't open pipe: %s", strerror(errno));
- if (set_nonblocking(main_pipe[1]) < 0)
+ if (set_nonblocking(event_pipe[1]) < 0)
g_error("Couldn't set non-blocking I/O: %s", strerror(errno));
- channel = g_io_channel_unix_new(main_pipe[0]);
+ channel = g_io_channel_unix_new(event_pipe[0]);
g_io_add_watch(channel, G_IO_IN, main_notify_event, NULL);
g_io_channel_unref(channel);
main_task = g_thread_self();
}
-void deinit_main_notify(void)
+void event_pipe_deinit(void)
{
- xclose(main_pipe[0]);
- xclose(main_pipe[1]);
+ xclose(event_pipe[0]);
+ xclose(event_pipe[1]);
}
-void wakeup_main_task(void)
+void event_pipe_signal(void)
{
- ssize_t w = write(main_pipe[1], "", 1);
+ ssize_t w = write(event_pipe[1], "", 1);
if (w < 0 && errno != EAGAIN && errno != EINTR)
g_error("error writing to pipe: %s", strerror(errno));
}
-void wait_main_task(void)
+void event_pipe_wait(void)
{
consume_pipe();
}