From 9c2012b85edf4e79f6bfc2e5262faa174962242a Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Thu, 6 May 2010 23:50:23 +0200 Subject: Disable signal support if sys/signal.h was not found. --- src/redshift.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/redshift.c') diff --git a/src/redshift.c b/src/redshift.c index d84e473..f58ef56 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -87,6 +87,8 @@ typedef union { #define TRANSITION_HIGH 3.0 +#ifdef HAVE_SYS_SIGNAL_H + static volatile sig_atomic_t exiting = 0; static volatile sig_atomic_t disable = 0; @@ -104,6 +106,13 @@ sigdisable(int signo) disable = 1; } +#else /* ! HAVE_SYS_SIGNAL_H */ + +static int exiting = 0; +static int disable = 0; + +#endif /* ! HAVE_SYS_SIGNAL_H */ + /* Restore saved gamma ramps with the appropriate adjustment method. */ static void @@ -527,6 +536,7 @@ main(int argc, char *argv[]) will be exactly 6500K. */ float adjustment_alpha = 0.0; +#ifdef HAVE_SYS_SIGNAL_H struct sigaction sigact; sigset_t sigset; sigemptyset(&sigset); @@ -543,6 +553,7 @@ main(int argc, char *argv[]) sigact.sa_mask = sigset; sigact.sa_flags = 0; sigaction(SIGUSR1, &sigact, NULL); +#endif /* HAVE_SYS_SIGNAL_H */ /* Continously adjust color temperature */ int done = 0; -- cgit v1.2.3-70-g09d2