]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: open-code LOG_MAKEPRI
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 8 Dec 2023 17:10:44 +0000 (18:10 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 12 Dec 2023 11:47:47 +0000 (12:47 +0100)
LOG_MAKEPRI between musl and glibc differ in their behavior.

musl performs the '<< 3' as part of the macro while glibc expects the
caller to do so.
Just provide our own implementation to avoid the issue.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 38a4480bbf807b26bedf39f68c81b20828681b02)

sys-utils/dmesg.c

index 6755f7ea3db797a609078c065a0e7979e252a0af..5a794834c33928bf7d5bfb885616c117bb1a3462 100644 (file)
@@ -125,7 +125,7 @@ static const struct dmesg_name level_names[] =
  * shifted code :-)
  */
 #define FAC_BASE(f)    ((f) >> 3)
-#define LOG_RAW_FAC_PRI(fac, pri)      LOG_MAKEPRI((fac << 3), (pri))
+#define LOG_RAW_FAC_PRI(fac, pri)      ((fac << 3) | pri)
 
 static const struct dmesg_name facility_names[] =
 {