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:
+4
-5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user