Commit eb457b71 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

test: Uncomment pipes

Otherwise there is no way to pass pipes test
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 5498ed17
......@@ -80,7 +80,7 @@ static int run_clone(void)
int main(int argc, char *argv[])
{
// int pipefd[2];
int pipefd[2];
int fd_shared, fd_private;
const char data_mark[] = "This is a data_mark marker";
void *mmap_shared, *mmap_private, *mmap_anon, *map_unreadable;
......@@ -94,10 +94,10 @@ int main(int argc, char *argv[])
printf("%s pid %d\n", argv[0], getpid());
// if (pipe(pipefd)) {
// perror("Can't create pipe");
// goto err;
// }
if (pipe(pipefd)) {
perror("Can't create pipe");
goto err;
}
fd_shared = open("testee-shared.img", O_RDWR | O_CREAT | O_TRUNC, 0600);
if (fd_shared < 0) {
......@@ -207,8 +207,8 @@ int main(int argc, char *argv[])
goto err;
if (child == 0) {
printf("first child pid: %d\n", getpid());
// while (read(pipefd[0], &buf, sizeof(buf)) > 0)
// sleep(3);
while (read(pipefd[0], &buf, sizeof(buf)) > 0)
sleep(3);
*(unsigned long *)mmap_anon_sh = 0x11111111;
while (1) {
printf("ping: %d\n", getpid());
......@@ -228,7 +228,7 @@ int main(int argc, char *argv[])
while (1) {
*(unsigned long *)mmap_anon_sh = 0x33333333;
printf("ping: %d\n", getpid());
// write(pipefd[1], &buf, sizeof(buf));
write(pipefd[1], &buf, sizeof(buf));
sleep(10);
}
}
......
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