sysctl: Correct stat on /etc/sysctl.conf
sysctl --system fails when the file /etc/sysctl.conf doesn't exists. This happens due to wrong check of stat(2) return code. Reference: https://www.freelists.org/post/procps/sysctl Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
committed by
Craig Small
parent
6a0850be7b
commit
2617d03a33
2
sysctl.c
2
sysctl.c
@ -655,7 +655,7 @@ static int PreloadSystem(void)
|
||||
}
|
||||
|
||||
|
||||
if (stat(DEFAULT_PRELOAD, &ts) < 0 || S_ISREG(ts.st_mode)) {
|
||||
if (stat(DEFAULT_PRELOAD, &ts) == 0 && S_ISREG(ts.st_mode)) {
|
||||
if (!Quiet)
|
||||
printf(_("* Applying %s ...\n"), DEFAULT_PRELOAD);
|
||||
rc |= Preload(DEFAULT_PRELOAD);
|
||||
|
Reference in New Issue
Block a user