aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-10-29 16:41:35 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-10-29 16:41:35 +0000
commit8418a50671c8edb25514c4ed87b18b4515941107 (patch)
tree6c7abbf1c2359312947e5f3772aa4be70fa4e3c7 /fetchmail.c
parent840a650a4eec2f319002434dcd971af96621c758 (diff)
downloadfetchmail-8418a50671c8edb25514c4ed87b18b4515941107.tar.gz
fetchmail-8418a50671c8edb25514c4ed87b18b4515941107.tar.bz2
fetchmail-8418a50671c8edb25514c4ed87b18b4515941107.zip
Added -n, --nodetach option.
svn path=/trunk/; revision=418
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);