[FFmpeg-cvslog] r22966 - trunk/libavdevice/v4l2.c
Luca Abeni
lucabe72
Wed Apr 28 09:41:24 CEST 2010
Stefano Sabatini wrote:
[...]
>>> and what if close() updates errno ?
>> You are right... Sorry for not noticing this issue before. I'll have
>> a look later, but I suspect the only thing we can do is to return a
>> fixed error number (ENODEV, in this case) or to save errno before
>> calling close().
>
> Check the attached patch.
> // ENOIOCTLCMD definition only availble on __KERNEL__
> - if (res < 0 && errno == 515) {
> + if (res < 0 && ((err = errno) == 515)) {
> av_log(ctx, AV_LOG_ERROR, "QUERYCAP not implemented, probably V4L device but not supporting V4L2\n");
> close(fd);
>
> - return AVERROR(errno);
> + return AVERROR(err);
This should obviously be "return 515" :)
Moreover, now that I think about it I am wondering if av_log() can
modify errno too...
Luca
More information about the ffmpeg-cvslog
mailing list