From ae26b182aecec9d0cdd1fa70378369c69cfac182 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 25 Aug 2023 19:10:21 -0400 Subject: [PATCH] Fix: erroneous specifier used with ERR_FMT macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ERR_FMT uses fmtlib's specifiers rather than the POSIX ones. Change-Id: Iadd914fe2f5556b4d2463a9a6861bcb4d40d9643 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.cpp | 2 +- src/bin/lttng/lttng.cpp | 2 +- tests/regression/tools/trigger/utils/notification-client.cpp | 2 +- tests/unit/test_action.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index 3e5d8eeea..bfd53e7e4 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -1982,7 +1982,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by main thread: %s", e.what()); + ERR_FMT("Unhandled exception caught by main thread: {}", e.what()); abort(); } } diff --git a/src/bin/lttng/lttng.cpp b/src/bin/lttng/lttng.cpp index 093a9809c..48b02c627 100644 --- a/src/bin/lttng/lttng.cpp +++ b/src/bin/lttng/lttng.cpp @@ -490,7 +490,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by client: %s", e.what()); + ERR_FMT("Unhandled exception caught by client: {}", e.what()); abort(); } } diff --git a/tests/regression/tools/trigger/utils/notification-client.cpp b/tests/regression/tools/trigger/utils/notification-client.cpp index 58ac01e6c..27bd100c6 100644 --- a/tests/regression/tools/trigger/utils/notification-client.cpp +++ b/tests/regression/tools/trigger/utils/notification-client.cpp @@ -287,7 +287,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by notification client: %s", e.what()); + ERR_FMT("Unhandled exception caught by notification client: {}", e.what()); abort(); } } diff --git a/tests/unit/test_action.cpp b/tests/unit/test_action.cpp index c46b8fcea..52f6d26ca 100644 --- a/tests/unit/test_action.cpp +++ b/tests/unit/test_action.cpp @@ -559,7 +559,7 @@ int main() try { return _main(); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by action unit test: %s", e.what()); + ERR_FMT("Unhandled exception caught by action unit test: {}", e.what()); abort(); } } -- 2.34.1