aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 5f76b8c2..7d9a71ca 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -50,6 +50,7 @@ int yydebug; /* enable parse debugging */
/* daemon mode control */
int poll_interval; /* poll interval in seconds */
+int nodetach; /* if TRUE, don't detach daemon process */
char *logfile; /* log file for daemon mode */
int quitmode; /* if --quit was set */
int check_only; /* if --probe was set */
@@ -434,7 +435,7 @@ char **argv;
/*
* Maybe time to go to demon mode...
*/
- if (poll_interval)
+ if (poll_interval && !nodetach)
daemonize(logfile, termhook);
/* beyond here we don't want more than one fetchmail running per user */
@@ -511,8 +512,22 @@ char **argv;
endhostent(); /* release TCP/IP connection to nameserver */
#endif /* HAVE_GETHOSTBYNAME */
+ if (outlevel == O_VERBOSE)
+ {
+ time_t now;
+
+ time(&now);
+ fprintf(stderr, "fetchmail: sleeping at %s", ctime(&now));
+ }
if (sleep(poll_interval))
(void) fputs("fetchmail: awakened by SIGHUP\n", stderr);
+ if (outlevel == O_VERBOSE)
+ {
+ time_t now;
+
+ time(&now);
+ fprintf(stderr, "fetchmail: awakened at %s", ctime(&now));
+ }
} while
(poll_interval);