]> Pileus Git - ~andy/fetchmail/commitdiff
Suppress monitor check after signal wakeup.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 29 Mar 2000 19:39:12 +0000 (19:39 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 29 Mar 2000 19:39:12 +0000 (19:39 -0000)
svn path=/trunk/; revision=2843

NEWS
fetchmail.c
fetchmail.h
interface.c

diff --git a/NEWS b/NEWS
index eae0ea54697831d7c64324ec1b6ebd73e53984a8..ef617dd76aa6f1a2434ad4dcc2ab2108270a5016 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,8 @@
 * Update for cs.po from Jiri Pavlovsky.
 * Prevent spurious hostname matches in fetchmailconf.
 * Ultrix 4.5 port patches from Simon Burge <simonb@thistledown.com.au>.
-* Add bug warnubng to FAQ about Lotus Domino.
+* Add bug warning to FAQ about Lotus Domino.
+* Suppress monitor check just after being woken by signal.
 
 fetchmail-5.3.4 (Wed Mar 22 15:55:51 EST 2000), 18819 lines:
 
index 76580ca2315954dd5bfe673ab8c509b04c283f43..9954774569db5a6c53c4b749a810ef2ba0be2918 100644 (file)
@@ -125,6 +125,7 @@ int main(int argc, char **argv)
     netrc_entry *netrc_list;
     char *netrc_file, *tmpbuf;
     pid_t pid;
+    int lastsig = 0;
 
 #ifdef __FreeBSD__
     dropprivs();
@@ -626,8 +627,11 @@ int main(int argc, char **argv)
                }
 
 #if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
-               /* interface_approve() does its own error logging */
-               if (!interface_approve(&ctl->server))
+               /*
+                * Don't do monitoring if we were woken by a signal.
+                * Note that interface_approve() does its own error logging.
+                */
+               if (!interface_approve(&ctl->server, !lastsig))
                    continue;
 #endif /* (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__) */
 
@@ -703,8 +707,6 @@ int main(int argc, char **argv)
         */
        if (run.poll_interval)
        {
-           int lastsig;
-
            /* 
             * Because passwords can expire, it may happen that *all*
             * hosts are now out of the loop due to authfail
@@ -731,7 +733,7 @@ int main(int argc, char **argv)
 
            /*
             * OK, now pause util it's time for the next poll cycle.
-            * A TRUE return indicates we received a wakeup signal;
+            * A nonzero return indicates we received a wakeup signal;
             * unwedge all servers in case the problem has been
             * manually repaired.
             */
index 605c469b001ab888ef4d297ad67597cae6dd6b6a..d23e9127201bd8c2bc93a7faddb765dac217f79f 100644 (file)
@@ -473,7 +473,7 @@ extern int  UnMimeBodyline(unsigned char **buf, flag delimited, flag issoftline)
 void interface_init(void);
 void interface_parse(char *, struct hostdata *);
 void interface_note_activity(struct hostdata *);
-int interface_approve(struct hostdata *);
+int interface_approve(struct hostdata *, flag domonitor);
 
 /* xmalloc.c */
 #if defined(HAVE_VOIDPOINTER)
index 7a485e78e1e74fce3626d8d107035935add4892a..7ba922f978ea745d38bf178ad307754d6660a86f 100644 (file)
@@ -434,7 +434,7 @@ void interface_note_activity(struct hostdata *hp)
 #endif
 }
 
-int interface_approve(struct hostdata *hp)
+int interface_approve(struct hostdata *hp, flag domonitor)
 /* return TRUE if OK to poll, FALSE otherwise */
 {
        ifinfo_t ifinfo;
@@ -460,7 +460,7 @@ int interface_approve(struct hostdata *hp)
        }
 
        /* if not monitoring link, all done */
-       if (!hp->monitor)
+       if (!domonitor || !hp->monitor)
                return(TRUE);
 
 #ifdef ACTIVITY_DEBUG