]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: make --follow work with --merge again
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 19 May 2023 07:17:29 +0000 (09:17 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 May 2023 14:48:13 +0000 (23:48 +0900)
Set --boot with --follow only if it's not already set and if --merge is
not used, since it's not compatible with --boot.

Follow-up to 2dd9285bac.
Resolves: #24565

src/journal/journalctl.c

index 62f74551ad0f6cad4028064a8d942f6c8ade275c..b0b95311f1cfbce76e60c18df97a922359f6f298 100644 (file)
@@ -551,11 +551,6 @@ static int parse_argv(int argc, char *argv[]) {
 
                 case 'f':
                         arg_follow = true;
-
-                        arg_boot = true;
-                        arg_boot_id = SD_ID128_NULL;
-                        arg_boot_offset = 0;
-
                         break;
 
                 case 'o':
@@ -1055,6 +1050,12 @@ static int parse_argv(int argc, char *argv[]) {
         if (arg_follow && !arg_no_tail && !arg_since && arg_lines == ARG_LINES_DEFAULT)
                 arg_lines = 10;
 
+        if (arg_follow && !arg_merge && !arg_boot) {
+                arg_boot = true;
+                arg_boot_id = SD_ID128_NULL;
+                arg_boot_offset = 0;
+        }
+
         if (!!arg_directory + !!arg_file + !!arg_machine + !!arg_root + !!arg_image > 1)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "Please specify at most one of -D/--directory=, --file=, -M/--machine=, --root=, --image=.");