From a3140279cc8c41a6d4cf169c3f6e94411fec4f95 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 23 Dec 1996 05:45:15 +0000 Subject: Introduced George Sipe's -I and -M options. svn path=/trunk/; revision=673 --- fetchmail.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 65c84933..0a93eaa4 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -60,6 +60,10 @@ int check_only; /* if --probe was set */ int cmd_batchlimit; /* if --batchlimit was set */ int cmd_fetchlimit; /* if --fetchlimit was set */ char *cmd_logfile; /* if --logfile was set */ +char *interface; /* interface required specification */ +char *cmd_interface; /* if --interface was set */ +char *monitor; /* monitored interface for activity */ +char *cmd_monitor; /* if --monitor was set */ /* miscellaneous global controls */ char *rcfile; /* path name of rc file */ @@ -417,6 +421,10 @@ 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; @@ -430,6 +438,9 @@ int main (int argc, char **argv) if (lastsig == SIGUSR1) (void) error(0, 0, "awakened by SIGUSR1"); } +#ifdef linux + } while (!interface_approve()); +#endif if (outlevel == O_VERBOSE) { @@ -605,6 +616,31 @@ static int load_params(int argc, char **argv, int optind) if (cmd_logfile) logfile = cmd_logfile; + /* if cmd_interface was explicitly set, use it to override interface */ + if (cmd_interface) + interface = cmd_interface; + + /* if cmd_monitor was explicitly set, use it to override monitor */ + if (cmd_monitor) + monitor = cmd_monitor; + + if (interface) +#ifdef linux + interface_parse(); +#else + { + (void) fprintf(stderr, + "interface specification supported only on Linux\n"); + exit(PS_SYNTAX); + } + if (monitor) + { + (void) fprintf(stderr, + "monitor supported only on Linux\n"); + exit(PS_SYNTAX); + } +#endif + return(implicitmode); } -- cgit v1.2.3