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) ...@@ -64,12 +64,10 @@ static int check_file_locks(int alt_pid)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int fd, pf[2], pid; int fd, pid;
test_init(argc, argv); test_init(argc, argv);
pipe(pf);
fd = open(filename, O_CREAT | O_RDWR, 0600); fd = open(filename, O_CREAT | O_RDWR, 0600);
if (fd < 0) { if (fd < 0) {
err("No file"); err("No file");
...@@ -80,12 +78,10 @@ int main(int argc, char **argv) ...@@ -80,12 +78,10 @@ int main(int argc, char **argv)
pid = fork(); pid = fork();
if (pid == 0) { if (pid == 0) {
close(pf[1]); test_waitsig();
read(pf[0], &pid, sizeof(pid));
exit(0); exit(0);
} }
close(pf[0]);
close(fd); close(fd);
test_daemon(); test_daemon();
...@@ -96,7 +92,7 @@ int main(int argc, char **argv) ...@@ -96,7 +92,7 @@ int main(int argc, char **argv)
else else
fail("Flock file locks check failed"); fail("Flock file locks check failed");
close(pf[1]); kill(pid, SIGTERM);
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
close(fd); close(fd);
unlink(filename); 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