aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2010-05-06 23:50:23 +0200
committerJon Lund Steffensen <jonlst@gmail.com>2010-05-06 23:50:23 +0200
commit9c2012b85edf4e79f6bfc2e5262faa174962242a (patch)
tree7e306471bfa7b30d5890124de24512ec488c96ba /src
parentconfigure.ac: Remove useless malloc check, add check for sys/signal.h. (diff)
downloadredshift-ng-9c2012b85edf4e79f6bfc2e5262faa174962242a.tar.gz
redshift-ng-9c2012b85edf4e79f6bfc2e5262faa174962242a.tar.bz2
redshift-ng-9c2012b85edf4e79f6bfc2e5262faa174962242a.tar.xz
Disable signal support if sys/signal.h was not found.
Diffstat (limited to 'src')
-rw-r--r--src/redshift.c11
1 files changed, 11 insertions, 0 deletions
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;