diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 1aa8c00512..092ff763ba 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1515,7 +1515,7 @@ static int test_calendar(int argc, char *argv[], void *userdata) { r = calendar_spec_to_string(spec, &t); if (r < 0) { - ret = log_error_errno(r, "Failed to fomat calendar specification '%s': %m", *p); + ret = log_error_errno(r, "Failed to format calendar specification '%s': %m", *p); continue; } diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 02715142e9..e0ad0e1d11 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -494,7 +494,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:S:U:t:u:NF:xrM:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:g:c:S:U:t:u:NF:xrM:", options, NULL)) >= 0) switch (c) { diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 3e5c785660..e8b77d2b0b 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -7488,7 +7488,6 @@ static int systemctl_parse_argv(int argc, char *argv[]) { ARG_NO_ASK_PASSWORD, ARG_FAILED, ARG_RUNTIME, - ARG_FORCE, ARG_PLAIN, ARG_STATE, ARG_JOB_MODE, @@ -7528,7 +7527,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { { "dry-run", no_argument, NULL, ARG_DRY_RUN }, { "quiet", no_argument, NULL, 'q' }, { "root", required_argument, NULL, ARG_ROOT }, - { "force", no_argument, NULL, ARG_FORCE }, + { "force", no_argument, NULL, 'f' }, { "no-reload", no_argument, NULL, ARG_NO_RELOAD }, { "kill-who", required_argument, NULL, ARG_KILL_WHO }, { "signal", required_argument, NULL, 's' }, @@ -7743,10 +7742,6 @@ static int systemctl_parse_argv(int argc, char *argv[]) { arg_quiet = true; break; - case ARG_FORCE: - arg_force++; - break; - case 'f': arg_force++; break; diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index 408d14133b..f748fbc878 100644 --- a/src/test/test-libudev.c +++ b/src/test/test-libudev.c @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) { return 1; } - while ((c = getopt_long(argc, argv, "p:s:dhV", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "p:s:dhVm", options, NULL)) >= 0) switch (c) { case 'p': diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index 6ff244e96c..eeed803f57 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -35,6 +35,7 @@ #include "efivars.h" #include "fd-util.h" #include "gpt.h" +#include "parse-util.h" #include "string-util.h" #include "udev.h" @@ -236,7 +237,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t bool is_gpt = false; static const struct option options[] = { - { "offset", optional_argument, NULL, 'o' }, + { "offset", required_argument, NULL, 'o' }, { "noraid", no_argument, NULL, 'R' }, {} }; @@ -244,13 +245,19 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t for (;;) { int option; - option = getopt_long(argc, argv, "oR", options, NULL); + option = getopt_long(argc, argv, "o:R", options, NULL); if (option == -1) break; switch (option) { case 'o': - offset = strtoull(optarg, NULL, 0); + err = safe_atoi64(optarg, &offset); + if (err < 0) + goto out; + if (offset < 0) { + err = -ERANGE; + goto out; + } break; case 'R': noraid = true;