various: use id128_from_string_not_null()

No functional change. In config_parse_address_generation_type() we would set
the output parameter and then say it's ignored, so it _looked_ like an error in
the code, but the variable was always initialized to SD_ID128_NULL anyway, so
the code was actually fine.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-09-02 14:16:25 +03:00
parent 7c9de5d85d
commit aea3f594db
5 changed files with 19 additions and 46 deletions
+4 -5
View File
@@ -976,13 +976,12 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_UUID:
r = sd_id128_from_string(optarg, &arg_uuid);
if (r < 0)
return log_error_errno(r, "Invalid UUID: %s", optarg);
if (sd_id128_is_null(arg_uuid))
r = id128_from_string_nonzero(optarg, &arg_uuid);
if (r == -ENXIO)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Machine UUID may not be all zeroes.");
if (r < 0)
return log_error_errno(r, "Invalid UUID: %s", optarg);
arg_settings_mask |= SETTING_MACHINE_ID;
break;