]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal-upload: drop custom option error handling
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 8 Dec 2025 09:52:11 +0000 (10:52 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 11 Feb 2026 10:48:29 +0000 (11:48 +0100)
commitc1fcc8042180b2b6e3c9acb525e730bd6d0c75d7
tree7b17471078630082f2e29137075c53785a1d1304
parent7b6f1ea371df5c504807198f2556f98f11293a86
journal-upload: drop custom option error handling

The line to set opterr=0 was added in the initial commit in
3d090cc6f34e5970765dd1e7ee5e648a056d180d. But afaict, this never worked as
intended, because ':' must be the first char in optstring given to
getopt_long() for it to return ':' for a missing option value. Since
this wasn't set, getopt_long() would return '?', and the missing value
would be handled as an unknown option:
  $ build/systemd-journal-upload --key
  Unknown option --key.
  $ build/systemd-journal-upload --asdf
  Unknown option --asdf.

Let's just do the standard thing:
  $ build/systemd-journal-upload --key
  build/systemd-journal-upload: option '--key' requires an argument
  $ build/systemd-journal-upload --asdf
  build/systemd-journal-upload: unrecognized option '--asdf'
src/journal-remote/journal-upload.c