X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=9e8158aaf0836aabb22cde749f79631b3210a6a2;hb=010e00bc54262e0ce57746068e916fc4a08b8f33;hp=07dd6d02d3b0d255d4424b9e8416990dcbe6dd9e;hpb=0b3acd3a1122d542e2994d7791cc9127e91778f1;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 07dd6d0..9e8158a 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: options.c,v 1.72 2000/04/04 07:06:52 paulus Exp $" +#define RCSID "$Id: options.c,v 1.74 2000/04/15 01:27:13 masputra Exp $" #include #include @@ -128,6 +128,7 @@ char *current_option; /* the name of the option being parsed */ int privileged_option; /* set iff the current option came from root */ char *option_source; /* string saying where the option came from */ bool log_to_file; /* log_to_fd is a file opened by us */ +bool log_to_specific_fd; /* log_to_fd was specified by user option */ /* * Prototypes @@ -191,7 +192,7 @@ option_t general_options[] = { "Set time in seconds before disconnecting idle link" }, { "lock", o_bool, &lockflag, "Lock serial device with UUCP-style lock file", 1 }, - { "-all", o_special_noarg, noopt, + { "-all", o_special_noarg, (void *)noopt, "Don't request/allow any LCP or IPCP options (useless)" }, { "init", o_string, &initializer, "A program to initialize the device", @@ -226,21 +227,21 @@ option_t general_options[] = { "Set alternate hardware (DTR/CTS) flow control", OPT_NOARG|OPT_VAL(2) }, { "nocdtrcts", o_int, &crtscts, "Disable hardware flow control", OPT_NOARG|OPT_VAL(-1) }, - { "xonxoff", o_special_noarg, setxonxoff, + { "xonxoff", o_special_noarg, (void *)setxonxoff, "Set software (XON/XOFF) flow control" }, - { "domain", o_special, setdomain, + { "domain", o_special, (void *)setdomain, "Add given domain name to hostname" }, { "mtu", o_int, &lcp_allowoptions[0].mru, "Set our MTU", OPT_LIMITS, NULL, MAXMRU, MINMRU }, - { "netmask", o_special, setnetmask, + { "netmask", o_special, (void *)setnetmask, "set netmask" }, { "modem", o_bool, &modem, "Use modem control lines", 1 }, { "local", o_bool, &modem, "Don't use modem control lines" }, - { "file", o_special, readfile, + { "file", o_special, (void *)readfile, "Take options from a file", OPT_PREPASS }, - { "call", o_special, callfile, + { "call", o_special, (void *)callfile, "Take options from a privileged file", OPT_PREPASS }, { "persist", o_bool, &persist, "Keep on reopening connection after close", 1 }, @@ -248,17 +249,18 @@ option_t general_options[] = { "Turn off persist option" }, { "demand", o_bool, &demand, "Dial on demand", OPT_INITONLY | 1, &persist }, - { "--version", o_special_noarg, showversion, + { "--version", o_special_noarg, (void *)showversion, "Show version number" }, - { "--help", o_special_noarg, showhelp, + { "--help", o_special_noarg, (void *)showhelp, "Show brief listing of options" }, - { "-h", o_special_noarg, showhelp, + { "-h", o_special_noarg, (void *)showhelp, "Show brief listing of options" }, { "sync", o_bool, &sync_serial, "Use synchronous HDLC serial encoding", 1 }, { "logfd", o_int, &log_to_fd, - "Send log messages to this file descriptor" }, - { "logfile", o_special, setlogfile, + "Send log messages to this file descriptor", + 0, &log_to_specific_fd }, + { "logfile", o_special, (void *)setlogfile, "Append log messages to this file" }, { "nolog", o_int, &log_to_fd, "Don't send log messages to any file", @@ -294,7 +296,7 @@ option_t general_options[] = { "Bundle name for multilink" }, #endif /* HAVE_MULTILINK */ #ifdef PLUGIN - { "plugin", o_special, loadplugin, + { "plugin", o_special, (void *)loadplugin, "Load a plug-in module into pppd", OPT_PRIV }, #endif @@ -1599,7 +1601,7 @@ loadplugin(argv) option_error("Couldn't load plugin %s", arg); return 0; } - init = dlsym(handle, "plugin_init"); + init = (void (*)(void))dlsym(handle, "plugin_init"); if (init == 0) { option_error("%s has no initialization entry point", arg); dlclose(handle);