Code

Merge remote branches 'jn/keydef' and 'jn/dev'
[ncmpc.git] / src / gidle.c
index d4fd8074351806ea56f7827e43848e1146097589..af7457d85b2850b342b340b02d315e4419f90aca 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
-   (c) 2004-2009 The Music Player Daemon Project
+   (c) 2004-2010 The Music Player Daemon Project
    Project homepage: http://musicpd.org
 
    Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,6 @@
 #include <glib.h>
 #include <assert.h>
 #include <string.h>
-#include <sys/select.h>
 #include <errno.h>
 
 struct mpd_glib_source {
@@ -337,7 +336,7 @@ mpd_glib_add_watch(struct mpd_glib_source *source)
        source->io_events = events;
 }
 
-void
+bool
 mpd_glib_enter(struct mpd_glib_source *source)
 {
        bool success;
@@ -347,17 +346,18 @@ mpd_glib_enter(struct mpd_glib_source *source)
        assert(!source->destroyed);
 
        if (source->leaving)
-               return;
+               return false;
 
        source->idle_events = 0;
 
        success = mpd_async_send_command(source->async, "idle", NULL);
        if (!success) {
                mpd_glib_invoke_async_error(source);
-               return;
+               return false;
        }
 
        mpd_glib_add_watch(source);
+       return true;
 }
 
 bool