aboutsummaryrefslogtreecommitdiffstats
path: root/idle.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-09-04 13:59:02 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-09-04 13:59:02 +0000
commitc8928081a5a9cbfaf16b14d4db57476bda8e1189 (patch)
tree2d7b495cd4352fd5facdeaeb500a394ba17b7714 /idle.c
parente588fb0f217d4ab7d1bfe8a1d292b8f556cefcb8 (diff)
downloadfetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.tar.gz
fetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.tar.bz2
fetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.zip
Cygwin port fix.
svn path=/trunk/; revision=3692
Diffstat (limited to 'idle.c')
-rw-r--r--idle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/idle.c b/idle.c
index 8e6f36dc..155f434b 100644
--- a/idle.c
+++ b/idle.c
@@ -22,6 +22,7 @@ MIT license. Compile with -DMAIN to build the demonstrator.
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
+#include <fetchmail.h> /* for ROOT_UID */
#ifndef TRUE
#define TRUE 1
@@ -154,12 +155,13 @@ int interruptible_idle(int seconds)
pause();
signal(SIGALRM, SIG_IGN);
#endif /* ! EMX */
- if (lastsig == SIGUSR1 || ((seconds && !getuid()) && lastsig == SIGHUP))
+ if (lastsig == SIGUSR1 || ((seconds && getuid() == ROOT_UID)
+ && lastsig == SIGHUP))
awoken = TRUE;
/* now lock out interrupts again */
signal(SIGUSR1, SIG_IGN);
- if (!getuid())
+ if (getuid() == ROOT_UID)
signal(SIGHUP, SIG_IGN);
return(awoken ? lastsig : 0);