mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
zdtm/file_locks03: don't use pipe for synchronization
Reported-by: Mr Jenkins Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
2ce6a6a2af
commit
4b0c0c5828
@@ -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);
|
||||
|
Reference in New Issue
Block a user