summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2012-09-21 12:30:56 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-21 16:12:47 +0200
commit089d4a08d0cda5bae0bf9bb3273bfdb397200ee8 (patch)
tree230a9c3d1af59ba194604f691e4fc3c5089742dc
parentd42c44fb6dd926271bfd56157114ba9d29935ea7 (diff)
sysctl: fix error code handling
After if (r <= 0) r can't be 0 so if (k < 0 && r == 0) never happens.
-rw-r--r--src/sysctl/sysctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 793796d363..62d4c81c47 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -260,6 +260,8 @@ int main(int argc, char *argv[]) {
if (r <= 0)
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+ r = 0;
+
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();