summaryrefslogtreecommitdiff
path: root/procps/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'procps/sysctl.c')
-rw-r--r--procps/sysctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/procps/sysctl.c b/procps/sysctl.c
index b5a0189..7c72ac9 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -202,7 +202,8 @@ int sysctl_write_setting(const char *setting, int output)
while ((cptr = strchr(outname, '/')) != NULL)
*cptr = '.';
- if ((fd = open(tmpname, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
+ fd = open(tmpname, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0) {
switch (errno) {
case ENOENT:
bb_error_msg(ERR_INVALID_KEY, outname);