-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
return 1;
}
- /* This will cause the read in the child to return. */
- close (fd[0]);
- close (fd[1]);
- close (fd[2]);
- close (fd[3]);
-
void *ret;
if (pthread_join (th, &ret) != 0)
{
return 1;
}
+ /* The pipe closing must be issued after the cancellation handling to avoid
+ a race condition where the cancellation runs after both pipe ends are
+ closed. In this case the read syscall returns EOF and the cancellation
+ must not act. */
+ close (fd[0]);
+ close (fd[1]);
+ close (fd[2]);
+ close (fd[3]);
+
return 0;
}
if (do_one_test ())
return 1;
+#ifdef SA_SIGINFO
sa.sa_sigaction = (void (*)(int, siginfo_t *, void *)) sh;
sigemptyset (&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
puts ("sa_flags = SA_SIGINFO|SA_ONSTACK test");
if (do_one_test ())
return 1;
+#endif
return 0;
}