Commit da0b8770 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

sysctl: don't skip erros

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 76e78a38
...@@ -344,7 +344,7 @@ out: ...@@ -344,7 +344,7 @@ out:
static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op) static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op)
{ {
int dir, ret = -1;; int dir, ret, exit_code = -1;;
dir = open("/proc/sys", O_RDONLY, O_DIRECTORY); dir = open("/proc/sys", O_RDONLY, O_DIRECTORY);
if (dir < 0) { if (dir < 0) {
...@@ -371,15 +371,16 @@ static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op) ...@@ -371,15 +371,16 @@ static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op)
} }
ret = do_sysctl_op(fd, req, op); ret = do_sysctl_op(fd, req, op);
if (ret)
goto out;
close(fd); close(fd);
req++; req++;
} }
ret = 0; exit_code = 0;
out: out:
close(dir); close(dir);
return ret; return exit_code;
} }
int sysctl_op(struct sysctl_req *req, size_t nr_req, int op, unsigned int ns) int sysctl_op(struct sysctl_req *req, size_t nr_req, int op, unsigned int ns)
......
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