Merge pull request #30518 from mrc0mmand/assorted-tweaks

A couple of assorted tweaks
This commit is contained in:
Yu Watanabe
2023-12-19 11:48:40 +09:00
committed by GitHub
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ int verify_set_unit_path(char **filenames) {
* Treat explicit empty path to mean that nothing should be appended. */
old = getenv("SYSTEMD_UNIT_PATH");
if (!streq_ptr(old, "") &&
!strextend_with_separator(&joined, ":", old ?: ""))
!strextend_with_separator(&joined, ":", strempty(old)))
return -ENOMEM;
assert_se(set_unit_path(joined) >= 0);
+2 -2
View File
@@ -1088,9 +1088,9 @@ static int parse_argv(int argc, char *argv[]) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--since= must be before --until=.");
if (!!arg_cursor + !!arg_after_cursor + !!arg_since_set > 1)
if (!!arg_cursor + !!arg_after_cursor + !!arg_cursor_file + !!arg_since_set > 1)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Please specify only one of --since=, --cursor=, and --after-cursor=.");
"Please specify only one of --since=, --cursor=, --cursor-file=, and --after-cursor=.");
if (arg_follow && arg_reverse)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+2 -2
View File
@@ -4906,7 +4906,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_PCRLOCK:
if (isempty(optarg) || streq(optarg, "-"))
if (empty_or_dash(optarg))
arg_pcrlock_path = mfree(arg_pcrlock_path);
else {
r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_pcrlock_path);
@@ -4918,7 +4918,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_POLICY:
if (isempty(optarg) || streq(optarg, "-"))
if (empty_or_dash(optarg))
arg_policy_path = mfree(arg_policy_path);
else {
r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_policy_path);