[vlc-devel] vlc: svn commit r22914 (funman)

Rafaël Carré funman at videolan.org
Wed Oct 31 12:49:14 CET 2007


Le Wed, 31 Oct 2007 08:07:52 +0100,
Rémi Denis-Courmont <rdenis at simphalempin.com> a écrit :

> 
> On Wed, 31 Oct 2007 03:51:24 +0100 (CET), Subversion daemon
> <svn at videolan.org> wrote:
> > r22914 | funman | 2007-10-31 03:51:23 +0100 (Wed, 31 Oct 2007) | 1
> > line Changed paths:
> >    M /trunk/src/vlc.c
> > 
> > Yes, sigwait() can fail, so don't ignore its return value
> 
> From Linux documentation:
> 
> "The !sigwait! function never returns an error."

why skipping EINVAL error ? :/

> From the more authoritative POSIX documentation:
> 
> "The sigwait() function may fail if:
>     [EINVAL]
>         The set argument contains an invalid or unsupported signal
> number."

FreeBSD just adds another error:
     [EFAULT]           Any arguments point outside the allocated
address space or there is a memory protection fault.

Since we statically set the arguments, we suppose that will not happen.

> which can never happen in our case. This commit is just plain wrong.

Remember, there is EINTR (Interrupted System Call).

EINTR can still happen, see 
http://www.unix.org/version2/whatsnew/threadsref.html

""
sigwait
Synopsis	int sigwait( const sigset_t *set, int *sig );
Description	Synchronously accept a signal
Errors	EINVAL,*EINTR*
""

But I know that sucks they didn't put it in the function man page :(

In fact I'd be glad to know wether or not EINTR can happen in every
system call, I only found:
http://www.ussg.iu.edu/hypermail/linux/kernel/0508.0/0022.html

+        if( sigwait (&fullset, &i_signal) != 0 )
+            continue;

You'll say I do not specifically check for EINTR, but since it's the
only error that can be returned that's good, and we don't need to
includ errno.h.

Remember:
[quote]
> "The !sigwait! function never returns an error."
Since we statically set the arguments, we suppose that will not happen
(other errors wrt the arguments).
[/quote]

Thanks

-- 
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20071031/b1b6be2e/attachment.sig>


More information about the vlc-devel mailing list