[CRIU] [PATCH] zdtm/file_locks03: don't use pipe for synchronization

Andrey Vagin avagin at openvz.org
Tue Sep 1 04:15:26 PDT 2015


Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/mount.h                      |  1 +
 test/zdtm/live/static/file_locks03.c | 10 +++-------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/include/mount.h b/include/mount.h
index d0a28d8..76a8e24 100644
--- a/include/mount.h
+++ b/include/mount.h
@@ -47,6 +47,7 @@ struct mount_info {
 	char			*mountpoint;
 	char			*ns_mountpoint;
 	unsigned		flags;
+	unsigned		sb_flags;
 	int			master_id;
 	int			shared_id;
 	struct fstype		*fstype;
diff --git a/test/zdtm/live/static/file_locks03.c b/test/zdtm/live/static/file_locks03.c
index fd45f9c..e27abfa 100644
--- a/test/zdtm/live/static/file_locks03.c
+++ b/test/zdtm/live/static/file_locks03.c
@@ -64,12 +64,10 @@ static int check_file_locks(int alt_pid)
 
 int main(int argc, char **argv)
 {
-	int fd, pf[2], pid;
+	int fd, pid;
 
 	test_init(argc, argv);
 
-	pipe(pf);
-
 	fd = open(filename, O_CREAT | O_RDWR, 0600);
 	if (fd < 0) {
 		err("No file");
@@ -80,12 +78,10 @@ int main(int argc, char **argv)
 
 	pid = fork();
 	if (pid == 0) {
-		close(pf[1]);
-		read(pf[0], &pid, sizeof(pid));
+		test_waitsig();
 		exit(0);
 	}
 
-	close(pf[0]);
 	close(fd);
 
 	test_daemon();
@@ -96,7 +92,7 @@ int main(int argc, char **argv)
 	else
 		fail("Flock file locks check failed");
 
-	close(pf[1]);
+	kill(pid, SIGTERM);
 	waitpid(pid, NULL, 0);
 	close(fd);
 	unlink(filename);
-- 
2.1.0



More information about the CRIU mailing list