]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: fix parser of --notify-ready=
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Jun 2025 08:45:47 +0000 (10:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Jul 2025 04:42:14 +0000 (06:42 +0200)
This switch takes a bool only, not an enum, hence don't claim otherwise
in the error log message.

src/nspawn/nspawn.c

index e3ffc8c41d9c36545b43ad5d3c004b469e401a34..f0cfd4f1aad8a072d4815677e430dcecf3645d66 100644 (file)
@@ -1332,11 +1332,10 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_NOTIFY_READY:
-                        r = parse_boolean(optarg);
+                        r = parse_boolean_argument("--notify-ready=", optarg, &arg_notify_ready);
                         if (r < 0)
-                                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                                       "%s is not a valid notify mode. Valid modes are: yes, no, and ready.", optarg);
-                        arg_notify_ready = r;
+                                return r;
+
                         arg_settings_mask |= SETTING_NOTIFY_READY;
                         break;