From fe63646351309883cd2c61eb12be475ce8979764 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 29 Oct 2011 19:34:57 -0700 Subject: [PATCH] main.c: Don't try to compile signal support on win32 --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index a57f35d..1b351c7 100644 --- a/src/main.c +++ b/src/main.c @@ -112,6 +112,7 @@ exit_and_cleanup(void) } } +#ifndef WIN32 static void catch_sigint(G_GNUC_UNUSED int sig) { @@ -157,6 +158,7 @@ catch_sigwinch(G_GNUC_UNUSED int sig) if (1 != write(sigwinch_pipes[1], &irrelevant, 1)) exit(EXIT_FAILURE); } +#endif /* WIN32 */ static void idle_callback(enum mpd_error error, @@ -542,7 +544,9 @@ timer_check_key_bindings(G_GNUC_UNUSED gpointer data) int main(int argc, const char *argv[]) { +#ifndef WIN32 struct sigaction act; +#endif #ifdef ENABLE_LOCALE #ifndef ENABLE_NLS G_GNUC_UNUSED @@ -595,6 +599,7 @@ main(int argc, const char *argv[]) /* parse command line options - 2 pass */ options_parse(argc, argv); +#ifndef WIN32 /* setup signal behavior - SIGINT */ sigemptyset(&act.sa_mask); act.sa_flags = 0; @@ -644,6 +649,7 @@ main(int argc, const char *argv[]) perror("sigaction(SIGPIPE)"); exit(EXIT_FAILURE); } +#endif ncu_init(); @@ -673,6 +679,7 @@ main(int argc, const char *argv[]) } #endif +#ifndef WIN32 if (!pipe(sigwinch_pipes) && !fcntl(sigwinch_pipes[1], F_SETFL, O_NONBLOCK)) { sigwinch_channel = g_io_channel_unix_new(sigwinch_pipes[0]); @@ -682,6 +689,7 @@ main(int argc, const char *argv[]) perror("sigwinch pipe creation failed"); exit(EXIT_FAILURE); } +#endif /* attempt to connect */ reconnect_source_id = g_timeout_add(1, timer_reconnect, NULL); -- 2.30.2