summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-13 15:55:10 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-14 15:59:09 +0100
commit86beb21302082e9df0aa8576b89fd29c9e1a43be (patch)
tree3b2a7fce94d144978236b919fe12f311c383872b /src/machine
parent76e5e267fcf4d5c8d1470769b97ad75a7c67394b (diff)
downloadsystemd-86beb21302082e9df0aa8576b89fd29c9e1a43be.tar.gz
systemctl,loginctl,machinectl: use a shared helper for arg_signal
I seems frivolous to yet another two -util.[ch] files, but the helper should be in shared/ and it doesn't seem to fit anywhere else.
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 3d6048eaff..1ae10e5880 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -39,6 +39,7 @@
#include "mkdir.h"
#include "nulstr-util.h"
#include "pager.h"
+#include "parse-argument.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
@@ -2715,15 +2716,9 @@ static int parse_argv(int argc, char *argv[]) {
break;
case 's':
- if (streq(optarg, "help")) {
- DUMP_STRING_TABLE(signal, int, _NSIG);
- return 0;
- }
-
- r = signal_from_string(optarg);
- if (r < 0)
- return log_error_errno(r, "Failed to parse signal string %s.", optarg);
- arg_signal = r;
+ r = parse_signal_argument(optarg, &arg_signal);
+ if (r <= 0)
+ return r;
break;
case ARG_NO_ASK_PASSWORD: