diff options
author | Craig Small <csmall@dropbear.xyz> | 2019-09-21 16:17:05 +1000 |
---|---|---|
committer | Craig Small <csmall@dropbear.xyz> | 2019-09-21 16:20:41 +1000 |
commit | 012db8222e1bce097d99cdf274d85835ec505f2b (patch) | |
tree | cd662c44d5e478e4f1161a2a8995b9f0f32bb718 /pidof.c | |
parent | 52f112d255da4c4267752e390664eceafc288a41 (diff) | |
download | procps-ng-012db8222e1bce097d99cdf274d85835ec505f2b.tar.gz |
pidof: Fix separator option
Short separator option used 's' instead of 'S' which
meant it pidof would use the single-shot option when you
meant separator.
Added alias for -S using -d to give some sysvinit pidof
compatibility.
References:
commit 73492b182dc60c1605d1b0d62de651fad97807af
procps-ng/procps#141
Diffstat (limited to 'pidof.c')
-rw-r--r-- | pidof.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -295,13 +295,13 @@ int main (int argc, char **argv) int first_pid = 1; const char *separator = " "; - const char *opts = "scnxmo:S:?Vh"; + const char *opts = "scdnxmo:S:?Vh"; static const struct option longopts[] = { {"check-root", no_argument, NULL, 'c'}, {"single-shot", no_argument, NULL, 's'}, {"omit-pid", required_argument, NULL, 'o'}, - {"separator", required_argument, NULL, 's'}, + {"separator", required_argument, NULL, 'S'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0} @@ -334,6 +334,7 @@ int main (int argc, char **argv) pidof_root = pid_link(getpid(), "root"); } break; + case 'd': /* sysv pidof uses this for S */ case 'S': separator = optarg; break; |