summaryrefslogtreecommitdiff
path: root/sysctl.c
diff options
context:
space:
mode:
authorCraig Small <csmall@enc.com.au>2013-04-07 09:30:59 +1000
committerCraig Small <csmall@enc.com.au>2013-04-07 09:30:59 +1000
commitc2707dc2d7dc92909e3f2041e699df93a8afe516 (patch)
treebc24e64cc484adeeedaf86c59a5d0fe062f99cd7 /sysctl.c
parenta0590348568f36069605f386a4908e4887b04b45 (diff)
downloadprocps-ng-c2707dc2d7dc92909e3f2041e699df93a8afe516.tar.gz
sysctl return value
Gilles brought up a warning message in sysctl.c sysctl.c: In function 'main': sysctl.c:767: warning: value computed is not used The return value of Preload was not being applied correctly to ret meaning sysctl would not return the correct value. Reference: http://www.freelists.org/post/procps/procpsng-337,18 Signed-off-by: Craig Small <csmall@enc.com.au>
Diffstat (limited to 'sysctl.c')
-rw-r--r--sysctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysctl.c b/sysctl.c
index 0756878..81d697e 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -764,15 +764,15 @@ int main(int argc, char *argv[])
int ret = EXIT_SUCCESS, i;
if (!preloadfile) {
if (!argc) {
- ret != Preload(DEFAULT_PRELOAD);
+ ret |= Preload(DEFAULT_PRELOAD);
}
} else {
/* This happens when -pfile option is
* used without space. */
- Preload(preloadfile);
+ ret |= Preload(preloadfile);
}
for (i = 0; i < argc; i++)
- Preload(argv[i]);
+ ret |= Preload(argv[i]);
return ret;
}