Commit e2c64a94 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

zdtm/static/autofs: stop children before c/r

A static test has to be stopped, because zdtm.py compares file descriptors
before and after c/r.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent f62818d9
...@@ -34,6 +34,7 @@ TEST_OPTION(dirname, string, "directory name", 1); ...@@ -34,6 +34,7 @@ TEST_OPTION(dirname, string, "directory name", 1);
#define INDIRECT_MNT_DIR "mnt" #define INDIRECT_MNT_DIR "mnt"
int autofs_dev; int autofs_dev;
task_waiter_t t;
static char *xvstrcat(char *str, const char *fmt, va_list args) static char *xvstrcat(char *str, const char *fmt, va_list args)
{ {
...@@ -568,6 +569,7 @@ static int automountd(struct autofs_params *p, int control_fd) ...@@ -568,6 +569,7 @@ static int automountd(struct autofs_params *p, int control_fd)
goto err; goto err;
} }
close(control_fd); close(control_fd);
task_waiter_complete(&t, getpid());
return automountd_loop(pipes[0], autofs_path, p); return automountd_loop(pipes[0], autofs_path, p);
err: err:
...@@ -599,6 +601,7 @@ static int start_automounter(struct autofs_params *p) ...@@ -599,6 +601,7 @@ static int start_automounter(struct autofs_params *p)
close(control_fd[0]); close(control_fd[0]);
exit(automountd(p, control_fd[1])); exit(automountd(p, control_fd[1]));
} }
task_waiter_wait4(&t, pid);
p->pid = pid; p->pid = pid;
close(control_fd[1]); close(control_fd[1]);
...@@ -877,6 +880,8 @@ int main(int argc, char **argv) ...@@ -877,6 +880,8 @@ int main(int argc, char **argv)
test_init(argc, argv); test_init(argc, argv);
task_waiter_init(&t);
if (mkdir(dirname, 0777) < 0) { if (mkdir(dirname, 0777) < 0) {
pr_perror("failed to create %s directory", dirname); pr_perror("failed to create %s directory", dirname);
return -1; return -1;
......
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