(though this seem to only happen with debuggers and (?)broken OSes)
[1] system() blocks SIGCHLD, and is probably not intended for multithreading
We cannot assume that blocking calls in other libraries ignore EINTR anyway,
so the only safe approach is to block in all threads (you can unblock it in
your thread if you really want it) except the signal handling thread.
switch (poll (ufd, fdc, 500))
{
case -1:
- if( errno == EINTR )
- continue;
goto error;
case 0: // timeout
switch (val)
{
case -1:
- if( errno == EINTR )
- continue;
msg_Err (p_this, "Write error: %s", net_strerror (net_errno));
goto out;
* Note that we set the signals after the vlc_create call. */
static const int sigs[] = { SIGINT, SIGHUP, SIGQUIT, SIGTERM };
/* Ignored signals */
- static const int ignored[] = { SIGALRM, SIGPIPE };
+ static const int ignored[] = { SIGALRM, SIGPIPE, SIGCHLD };
sigset_t set;
pthread_t sigth;