]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
logger: fix incorrect warning message when both --file and a message are specified
authorAlexander Kappner <alexander@kappner.info>
Wed, 13 Aug 2025 11:10:28 +0000 (04:10 -0700)
committerKarel Zak <kzak@redhat.com>
Tue, 9 Sep 2025 10:07:14 +0000 (12:07 +0200)
Logger warns that when both --file and a message are given, the message is ignored.
It does the opposite. Fix the warning message to conform to the observed behavior.

Example:
echo "You will not see this file in the log" > file.txt
logger -f file.txt "You will see this message in the log"

Signed-off-by: Alexander Kappner <agk@godking.net>
(cherry picked from commit 2a31355b11c3714cac2b6b60565b639aa32388f1)

misc-utils/logger.c

index 9c50c5a6fcd1f222ac7d0e3c54c5df9a9e5c6fc8..c8eff50701c825ecdd2e94a9bccc0fec53004d17 100644 (file)
@@ -1296,7 +1296,7 @@ int main(int argc, char **argv)
        argc -= optind;
        argv += optind;
        if (stdout_reopened && argc)
-               warnx(_("--file <file> and <message> are mutually exclusive, message is ignored"));
+               warnx(_("--file <file> and <message> are mutually exclusive; file is ignored"));
 #ifdef HAVE_LIBSYSTEMD
        if (jfd) {
                int ret = journald_entry(&ctl, jfd);