]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredumpctl: use strv_skip()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Mar 2024 20:18:41 +0000 (05:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Mar 2024 12:39:37 +0000 (21:39 +0900)
No functional change, just refactoring.

src/coredump/coredumpctl.c

index 8ff9e34bdd348936219894fe9d46e87188d980e2..fe74c77e4840cca8eb0fb1644c78157aebf7c745 100644 (file)
@@ -879,7 +879,7 @@ static int dump_list(int argc, char **argv, void *userdata) {
 
         verb_is_info = argc >= 1 && streq(argv[0], "info");
 
-        r = acquire_journal(&j, argv + 1);
+        r = acquire_journal(&j, strv_skip(argv, 1));
         if (r < 0)
                 return r;
 
@@ -1130,7 +1130,7 @@ static int dump_core(int argc, char **argv, void *userdata) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "Option --field/-F only makes sense with list");
 
-        r = acquire_journal(&j, argv + 1);
+        r = acquire_journal(&j, strv_skip(argv, 1));
         if (r < 0)
                 return r;
 
@@ -1203,7 +1203,7 @@ static int run_debug(int argc, char **argv, void *userdata) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "Option --field/-F only makes sense with list");
 
-        r = acquire_journal(&j, argv + 1);
+        r = acquire_journal(&j, strv_skip(argv, 1));
         if (r < 0)
                 return r;