From da927ba997d68401563b927f92e6e40e021a8e5c Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 13:19:16 +0100 Subject: treewide: no need to negate errno for log_*_errno() It corrrectly handles both positive and negative errno values. --- src/test/test-boot-timestamps.c | 6 +++--- src/test/test-hostname.c | 2 +- src/test/test-ns.c | 2 +- src/test/test-socket-util.c | 2 +- src/test/test-watchdog.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/test') diff --git a/src/test/test-boot-timestamps.c b/src/test/test-boot-timestamps.c index 354307cba1..06d93af533 100644 --- a/src/test/test-boot-timestamps.c +++ b/src/test/test-boot-timestamps.c @@ -37,7 +37,7 @@ static int test_acpi_fpdt(void) { r = acpi_get_boot_usec(&loader_start, &loader_exit); if (r < 0) { if (r != -ENOENT) - log_error_errno(-r, "Failed to read ACPI FPDT: %m"); + log_error_errno(r, "Failed to read ACPI FPDT: %m"); return r; } @@ -60,7 +60,7 @@ static int test_efi_loader(void) { r = efi_loader_get_boot_usec(&loader_start, &loader_exit); if (r < 0) { if (r != -ENOENT) - log_error_errno(-r, "Failed to read EFI loader data: %m"); + log_error_errno(r, "Failed to read EFI loader data: %m"); return r; } @@ -84,7 +84,7 @@ int main(int argc, char* argv[]) { r = boot_timestamps(NULL, &fw, &l); if (r < 0) { - log_error_errno(-r, "Failed to read variables: %m"); + log_error_errno(r, "Failed to read variables: %m"); return 1; } diff --git a/src/test/test-hostname.c b/src/test/test-hostname.c index 1bc4126590..86efa1a3f7 100644 --- a/src/test/test-hostname.c +++ b/src/test/test-hostname.c @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) { r = hostname_setup(); if (r < 0) - log_error_errno(-r, "hostname: %m"); + log_error_errno(r, "hostname: %m"); return 0; } diff --git a/src/test/test-ns.c b/src/test/test-ns.c index fa297f9183..e66d97ff33 100644 --- a/src/test/test-ns.c +++ b/src/test/test-ns.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { PROTECT_SYSTEM_NO, 0); if (r < 0) { - log_error_errno(-r, "Failed to setup namespace: %m"); + log_error_errno(r, "Failed to setup namespace: %m"); return 1; } diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index d268423cc4..6fb4a40944 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -258,7 +258,7 @@ static void test_nameinfo_pretty(void) { _cleanup_close_ int sfd = -1, cfd = -1; r = getnameinfo_pretty(STDIN_FILENO, &stdin_name); - log_info_errno(-r, "No connection remote: %m"); + log_info_errno(r, "No connection remote: %m"); assert_se(r < 0); diff --git a/src/test/test-watchdog.c b/src/test/test-watchdog.c index 72e0c03dd7..f6bb045c3c 100644 --- a/src/test/test-watchdog.c +++ b/src/test/test-watchdog.c @@ -35,13 +35,13 @@ int main(int argc, char *argv[]) { r = watchdog_set_timeout(&t); if (r < 0) - log_warning_errno(-r, "Failed to open watchdog: %m"); + log_warning_errno(r, "Failed to open watchdog: %m"); for (i = 0; i < 5; i++) { log_info("Pinging..."); r = watchdog_ping(); if (r < 0) - log_warning_errno(-r, "Failed to ping watchdog: %m"); + log_warning_errno(r, "Failed to ping watchdog: %m"); usleep(t/2); } -- cgit v1.2.3-54-g00ecf