summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-25 19:17:10 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-26 01:52:45 +0100
commit6cebe83cfa656365348ff21f567d133c7e34a71d (patch)
treeb2b5ea6040468f29854f4a18dfe7e98c71a4d17c /src
parent43a99a7afe3063eebc901452026b13360b69a7b5 (diff)
Revert "journalctl: remove unexpected behavior of journalctl -b"
This reverts commit cf5bccc2bb9569030cb04debbc4208aaca0fe5b4. We should fix thinks properly if they aren't perfect, not just break other things...
Diffstat (limited to 'src')
-rw-r--r--src/journal/journalctl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index b347dfa187..cb252eb0b8 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -371,7 +371,18 @@ static int parse_argv(int argc, char *argv[]) {
case 'b':
arg_boot = true;
- arg_boot_descriptor = optarg;
+
+ if (optarg)
+ arg_boot_descriptor = optarg;
+ else if (optind < argc) {
+ int boot;
+
+ if (argv[optind][0] != '-' ||
+ safe_atoi(argv[optind], &boot) >= 0) {
+ arg_boot_descriptor = argv[optind];
+ optind++;
+ }
+ }
break;