logger: fix -i=ppid
For short options (-i) the optional argument contains '='. Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
852feb7299
commit
e598686d3c
|
@ -592,9 +592,13 @@ int main(int argc, char **argv)
|
|||
case 'i': /* log process id also */
|
||||
ctl.logflags |= LOG_PID;
|
||||
if (optarg) {
|
||||
if (!strcmp(optarg, "ppid"))
|
||||
const char *p = optarg;
|
||||
|
||||
if (*p == '=')
|
||||
p++;
|
||||
if (!strcmp(p, "ppid"))
|
||||
ctl.ppid = 1;
|
||||
else if (!strcmp(optarg, "pid"))
|
||||
else if (!strcmp(p, "pid"))
|
||||
ctl.ppid = 0;
|
||||
else
|
||||
warnx(_("ignoring unknown option argument: %s"), optarg);
|
||||
|
|
Loading…
Reference in New Issue