Commit 4b0c0c58 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm/file_locks03: don't use pipe for synchronization

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2ce6a6a2
......@@ -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);
......
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