[CRIU] [PATCH 1/4] zdtm/ipc_namespaces: don't extra symbols in a sysctl file

Andrey Vagin avagin at openvz.org
Wed Aug 13 06:51:02 PDT 2014


The kernel has a bug in handling auto_msgmni and if we send extra
symbols, a new value isn't applied.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/ipc_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/zdtm/live/static/ipc_namespace.c b/test/zdtm/live/static/ipc_namespace.c
index 872dea7..d54c387 100644
--- a/test/zdtm/live/static/ipc_namespace.c
+++ b/test/zdtm/live/static/ipc_namespace.c
@@ -207,7 +207,7 @@ static int rand_ipc_sysctl(char *name, unsigned int val)
 		return fd;
 	}
 	sprintf(buf, "%d\n", val);
-	ret = write(fd, buf, 32);
+	ret = write(fd, buf, strlen(buf));
 	if (ret < 0) {
 		err("Can't write %u into %s\n", val, name);
 		return -errno;
-- 
1.9.3



More information about the CRIU mailing list