File: logger-fix-incorrect-warning-message-when-both-file-and-a.patch

package info (click to toggle)
util-linux 2.41.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,992 kB
  • sloc: ansic: 179,068; sh: 22,693; yacc: 1,284; makefile: 530; xml: 422; python: 316; lex: 89; ruby: 75; csh: 37; exp: 19; sed: 16; perl: 15; sql: 9
file content (30 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Alexander Kappner <alexander@kappner.info>
Date: Wed, 13 Aug 2025 04:10:28 -0700
Subject: logger: fix incorrect warning message when both --file and a message
 are specified

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>
---
 misc-utils/logger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index a96b005..7101fac 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -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);