Commit 2617d03a by Victor Ananjevsky Committed by Craig Small

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/sysctlSigned-off-by: Craig Small's avatarCraig Small <csmall@enc.com.au>
parent 6a0850be
Pipeline #53201 passed with stage
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment