[vlc-devel] [PATCH 1/2] V4L2: Open devices only once.

Rémi Denis-Courmont remi at remlab.net
Thu Aug 4 13:03:14 CEST 2011


On Thu, 4 Aug 2011 12:58:47 +0200, Thierry Reding
<thierry.reding at avionic-design.de> wrote:
>> >      if( i_fd >= 0 ) v4l2_close( i_fd );
>> > -    return false;
>> > +    return VLC_EGENERIC;
>> 
>> You really should use -1 for this.
> 
> -1 is defined as VLC_ENOMEM. It's kind of a moot point because the
return
> value from InitVideoDev() is not used anyway.

The point is, we always use -1 as the error value for file descriptors, as
does POSIX.

I'd rather not mix the file descriptors space with the VLC error codes
space.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list