X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=5e1489f495779d9e58a481f5177ecda66c9166b5;hb=56371803b11c557e07ae968bef34b178b518139d;hp=177488ca681392c3971e432642c7e97a0638a894;hpb=53aeb75a17f1118db121088269b38a097283126f;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 177488c..5e1489f 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -79,7 +79,6 @@ char *strdup __P((char *)); #endif -static const char rcsid[] = RCSID; struct option_value { struct option_value *next; @@ -97,6 +96,9 @@ char devnam[MAXPATHLEN]; /* Device name */ bool nodetach = 0; /* Don't detach from controlling tty */ bool updetach = 0; /* Detach once link is up */ bool master_detach; /* Detach when we're (only) multilink master */ +#ifdef SYSTEMD +bool up_sdnotify = 0; /* Notify systemd once link is up */ +#endif int maxconnect = 0; /* Maximum connect time */ char user[MAXNAMELEN]; /* Username for PAP */ char passwd[MAXSECRETLEN]; /* Password for PAP */ @@ -209,6 +211,11 @@ option_t general_options[] = { "Don't detach from controlling tty", OPT_PRIO | 1 }, { "-detach", o_bool, &nodetach, "Don't detach from controlling tty", OPT_ALIAS | OPT_PRIOSUB | 1 }, +#ifdef SYSTEMD + { "up_sdnotify", o_bool, &up_sdnotify, + "Notify systemd once link is up (implies nodetach)", + OPT_PRIOSUB | OPT_A2COPY | 1, &nodetach }, +#endif { "updetach", o_bool, &updetach, "Detach from controlling tty once link is up", OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach }, @@ -984,7 +991,7 @@ print_option(opt, mainopt, printer, arg) p = (char *) opt->addr2; if ((opt->flags & OPT_STATIC) == 0) p = *(char **)p; - printer("%q", p); + printer(arg, "%q", p); } else if (opt->flags & OPT_A2LIST) { struct option_value *ovp; @@ -1745,7 +1752,7 @@ user_unsetenv(argv) option_error("unexpected = in name: %s", arg); return 0; } - if (arg == '\0') { + if (*arg == '\0') { option_error("missing variable name for unset"); return 0; }