[CRIU] [PATCH] sysctl: don't stop on a non-existent sysctl (v2)
    Andrey Vagin 
    avagin at gmail.com
       
    Tue Dec  8 00:48:10 PST 2015
    
    
  
From: Andrey Vagin <avagin at openvz.org>
We need to increment req, if we met a non-existent sysctl
v2: typo fix
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sysctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysctl.c b/sysctl.c
index fb9293b..819ad7c 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -362,8 +362,10 @@ static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op)
 
 		fd = openat(dir, req->name, flags);
 		if (fd < 0) {
-			if (errno == ENOENT && (req->flags & CTL_FLAGS_OPTIONAL))
+			if (errno == ENOENT && (req->flags & CTL_FLAGS_OPTIONAL)) {
+				req++;
 				continue;
+			}
 			pr_perror("Can't open sysctl %s", req->name);
 			goto out;
 		}
-- 
2.4.3
    
    
More information about the CRIU
mailing list