chiark / gitweb /
log: add an "error" parameter to all low-level logging calls and intrdouce log_error_...
[elogind.git] / src / test / test-hostname.c
index 8c1a60f94078cb3d124c207db53d520eee5875bb..1bc4126590b529938f2eb8f21a62495e2f39cb5c 100644 (file)
@@ -30,8 +30,9 @@
 int main(int argc, char* argv[]) {
         int r;
 
-        if ((r = hostname_setup()) < 0)
-                fprintf(stderr, "hostname: %s\n", strerror(-r));
+        r = hostname_setup();
+        if (r < 0)
+                log_error_errno(-r, "hostname: %m");
 
         return 0;
 }