- /* Make sure we track vlc_object_signal() */
- ufd[n].fd = vlc_object_waitpipe( p_sd );
- ufd[n].events = POLLIN | POLLHUP;
- ufd[n].revents = 0;
-
- if( ufd[n].fd == -1 )
- {
- /* On windows, fd will be -1, as we can't select on a pipe()-ed
- * fildes. Because we have no other solution to track that
- * object is killed, we make sure the timeout won't be to long. */
- if( timeout > 1000 || timeout == -1 )
- timeout = 1000;
- }
-
- vlc_object_unlock( p_sd );
-
- if (poll (ufd, n+1, timeout) > 0)
+ int val = poll (ufd, n, timeout);
+ canc = vlc_savecancel ();
+ if (val > 0)