+2014-02-27 Pedro Alves <palves@redhat.com>
+
+ * nat/linux-waitpid.c (my_waitpid): Only block signals if WNOHANG
+ isn't set.
+
2014-02-27 Pedro Alves <palves@redhat.com>
PR 12702
wnohang = (flags & WNOHANG) != 0;
flags &= ~(__WALL | __WCLONE);
- flags |= WNOHANG;
- /* Block all signals while here. This avoids knowing about
- LinuxThread's signals. */
- sigfillset (&block_mask);
- sigprocmask (SIG_BLOCK, &block_mask, &org_mask);
+ if (!wnohang)
+ {
+ flags |= WNOHANG;
+
+ /* Block all signals while here. This avoids knowing about
+ LinuxThread's signals. */
+ sigfillset (&block_mask);
+ sigprocmask (SIG_BLOCK, &block_mask, &org_mask);
- /* ... except during the sigsuspend below. */
- sigemptyset (&wake_mask);
+ /* ... except during the sigsuspend below. */
+ sigemptyset (&wake_mask);
+ }
while (1)
{
flags ^= __WCLONE;
}
- sigprocmask (SIG_SETMASK, &org_mask, NULL);
+ if (!wnohang)
+ sigprocmask (SIG_SETMASK, &org_mask, NULL);
}
else
{