aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-26 18:56:47 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-26 18:56:47 +0000
commit9e6cbca366809d2da3273ba76e22b1b195ac0428 (patch)
tree46695fedffcca49117e62d84c6ed76ed875e30d4 /fetchmail.c
parent377570143098232bbbe0edd493b55ceb7e4d1fe4 (diff)
downloadfetchmail-9e6cbca366809d2da3273ba76e22b1b195ac0428.tar.gz
fetchmail-9e6cbca366809d2da3273ba76e22b1b195ac0428.tar.bz2
fetchmail-9e6cbca366809d2da3273ba76e22b1b195ac0428.zip
Support interface check in foreground as well as daemon mode.
svn path=/trunk/; revision=697
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 61bafc4c..7952523d 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -335,6 +335,13 @@ int main (int argc, char **argv)
* reflect the status of that transaction.
*/
do {
+#ifdef linux
+ if (poll_interval && monitor)
+ sleep(3); /* allow some time for the link to quiesce */
+
+ interface_note_activity();
+#endif
+
if (poll_interval)
{
if (outlevel == O_VERBOSE)
@@ -351,10 +358,6 @@ int main (int argc, char **argv)
* We'll just assume setitimer(2) is available since fetchmail
* has to have a BSDoid socket layer to work at all.
*/
-#ifdef linux
- do {
- interface_note_activity();
-#endif
{
struct itimerval ntimeout;
@@ -370,9 +373,6 @@ int main (int argc, char **argv)
(void) error(0, 0, "awakened by SIGUSR1");
}
}
-#ifdef linux
- } while (!interface_approve());
-#endif
if (outlevel == O_VERBOSE)
{
@@ -383,6 +383,12 @@ int main (int argc, char **argv)
}
}
+
+#ifdef linux
+ if (!interface_approve())
+ continue;
+#endif
+
#ifdef HAVE_RES_SEARCH
sethostent(TRUE); /* use TCP/IP for mailserver queries */
#endif /* HAVE_RES_SEARCH */