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
1 changed files with 6 additions and 2 deletions
|
@ -592,9 +592,13 @@ int main(int argc, char **argv)
|
||||||
case 'i': /* log process id also */
|
case 'i': /* log process id also */
|
||||||
ctl.logflags |= LOG_PID;
|
ctl.logflags |= LOG_PID;
|
||||||
if (optarg) {
|
if (optarg) {
|
||||||
if (!strcmp(optarg, "ppid"))
|
const char *p = optarg;
|
||||||
|
|
||||||
|
if (*p == '=')
|
||||||
|
p++;
|
||||||
|
if (!strcmp(p, "ppid"))
|
||||||
ctl.ppid = 1;
|
ctl.ppid = 1;
|
||||||
else if (!strcmp(optarg, "pid"))
|
else if (!strcmp(p, "pid"))
|
||||||
ctl.ppid = 0;
|
ctl.ppid = 0;
|
||||||
else
|
else
|
||||||
warnx(_("ignoring unknown option argument: %s"), optarg);
|
warnx(_("ignoring unknown option argument: %s"), optarg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue