[systemd-devel] [PATCH] journalctl: require argument for --priority

Lekensteyn lekensteyn at gmail.com
Thu Nov 15 03:17:03 PST 2012


This fixes a segfault due to a missing value for --priority. -p is
unaffected because it is specified in the getopt_long parameter list.
---
 src/journal/journalctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index cccd8a7..011a11b 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -157,7 +157,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "this-boot",    no_argument,       NULL, 'b'              },
                 { "directory",    required_argument, NULL, 'D'              },
                 { "header",       no_argument,       NULL, ARG_HEADER       },
-                { "priority",     no_argument,       NULL, 'p'              },
+                { "priority",     required_argument, NULL, 'p'              },
                 { "setup-keys",   no_argument,       NULL, ARG_SETUP_KEYS   },
                 { "interval",     required_argument, NULL, ARG_INTERVAL     },
                 { "verify",       no_argument,       NULL, ARG_VERIFY       },
-- 
1.8.0




More information about the systemd-devel mailing list