diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-03-07 22:31:52 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-03-07 22:31:52 +0000 |
commit | acb75880b50674727da204e77ccfd3a5d07f1d96 (patch) | |
tree | b90793059152c2abae5f679363b989062acc6345 | |
parent | 6ac208976c5ac5839f92ac80ed00b0120d96fad5 (diff) | |
download | fetchmail-acb75880b50674727da204e77ccfd3a5d07f1d96.tar.gz fetchmail-acb75880b50674727da204e77ccfd3a5d07f1d96.tar.bz2 fetchmail-acb75880b50674727da204e77ccfd3a5d07f1d96.zip |
Reorganization.
svn path=/trunk/; revision=1694
-rw-r--r-- | fetchmail.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/fetchmail.c b/fetchmail.c index 0f187c68..feeb392d 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -561,17 +561,11 @@ int main (int argc, char **argv) */ { #ifndef __EMX__ -#ifndef SLEEP_WITH_ALARM /* not normally on */ - struct timeval timeout; - - timeout.tv_sec = poll_interval; - timeout.tv_usec = 0; - lastsig = 0; - select(0,0,0,0, &timeout); -#else +#ifdef SLEEP_WITH_ALARM /* not normally on */ /* - * This code is flaky under Red Hat Linux 5.0, and possibly - * elsewhere. John Stracke <francis@netscape.com> writes: + * This code stops working under glibc-2, apparently due + * to the change in signal(2) semantics. John Stracke + * <francis@netscape.com> writes: * * The problem seems to be that, after hitting the interval * timer while talking to the server, the process no longer @@ -585,14 +579,7 @@ int main (int argc, char **argv) * to repoll--but, when the dummy server didn't respond, it * never timed out, and SIGALRM wouldn't make it. * - * So the workaround I used is to make it sleep by using - * select() instead of setitimer()/pause(). select() is - * perfectly happy being called with a timeout and - * no file descriptors; it just sleeps until it hits the - * timeout. The only concern I had was that it might - * implement its timeout with SIGALRM--there are some - * Unices where this is done, because select() is a library - * function--but apparently not. + * (continued below...) */ struct itimerval ntimeout; @@ -604,6 +591,23 @@ int main (int argc, char **argv) signal(SIGALRM, donothing); pause(); signal(SIGALRM, SIG_IGN); +#else + /* + * So the workaround I used is to make it sleep by using + * select() instead of setitimer()/pause(). select() is + * perfectly happy being called with a timeout and + * no file descriptors; it just sleeps until it hits the + * timeout. The only concern I had was that it might + * implement its timeout with SIGALRM--there are some + * Unices where this is done, because select() is a library + * function--but apparently not. + */ + struct timeval timeout; + + timeout.tv_sec = poll_interval; + timeout.tv_usec = 0; + lastsig = 0; + select(0,0,0,0, &timeout); #endif #else /* EMX */ signal(SIGALRM, donothing); |