aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/event_pipe.c5
-rw-r--r--src/event_pipe.h2
-rw-r--r--src/main.c2
-rw-r--r--src/main.h2
-rw-r--r--src/update.c1
5 files changed, 5 insertions, 7 deletions
diff --git a/src/event_pipe.c b/src/event_pipe.c
index 8d9a7fed3..6398e9bbb 100644
--- a/src/event_pipe.c
+++ b/src/event_pipe.c
@@ -26,7 +26,6 @@
#include <glib.h>
#include <string.h>
-GThread *main_task;
static int event_pipe[2];
static GMutex *event_pipe_mutex;
static bool pipe_events[PIPE_EVENT_MAX];
@@ -78,8 +77,6 @@ void event_pipe_init(void)
{
GIOChannel *channel;
- main_task = g_thread_self();
-
if (pipe(event_pipe) < 0)
g_error("Couldn't open pipe: %s", strerror(errno));
if (set_nonblocking(event_pipe[1]) < 0)
@@ -90,8 +87,6 @@ void event_pipe_init(void)
g_io_channel_unref(channel);
event_pipe_mutex = g_mutex_new();
-
- main_task = g_thread_self();
}
void event_pipe_deinit(void)
diff --git a/src/event_pipe.h b/src/event_pipe.h
index 6205ab867..d8a042c7a 100644
--- a/src/event_pipe.h
+++ b/src/event_pipe.h
@@ -44,8 +44,6 @@ enum pipe_event {
typedef void (*event_pipe_callback_t)(void);
-extern GThread *main_task;
-
void event_pipe_init(void);
void event_pipe_deinit(void);
diff --git a/src/main.c b/src/main.c
index b7154b4bb..c44b6df97 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,6 +76,7 @@
#include <locale.h>
#endif
+GThread *main_task;
GMainLoop *main_loop;
struct notify main_notify;
@@ -242,6 +243,7 @@ int main(int argc, char *argv[])
changeToUser();
+ main_task = g_thread_self();
main_loop = g_main_loop_new(NULL, FALSE);
notify_init(&main_notify);
diff --git a/src/main.h b/src/main.h
index 44c06b6bb..30aefc272 100644
--- a/src/main.h
+++ b/src/main.h
@@ -21,6 +21,8 @@
#include <glib.h>
+extern GThread *main_task;
+
extern GMainLoop *main_loop;
extern struct notify main_notify;
diff --git a/src/update.c b/src/update.c
index ae407f157..e313f0aef 100644
--- a/src/update.c
+++ b/src/update.c
@@ -30,6 +30,7 @@
#include "update.h"
#include "idle.h"
#include "conf.h"
+#include "main.h"
#include <glib.h>