After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722953 - v4l2: ENODATA is Linux-only
v4l2: ENODATA is Linux-only
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other FreeBSD
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-25 06:02 UTC by Allison Karlitskaya (desrt)
Modified: 2014-02-04 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2: guard use of ENODATA with #ifdef (1.17 KB, patch)
2014-01-25 07:07 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2014-01-25 06:02:36 UTC
FreeBSD supports v4l, but we use ENODATA in sys/v4l2/v4l2_calls.c (since bug 698827).

Probably the best way to fix this is with a simple #ifdef -- ENODATA is #define'd on Linux.
Comment 1 Allison Karlitskaya (desrt) 2014-01-25 07:07:14 UTC
Created attachment 267175 [details] [review]
v4l2: guard use of ENODATA with #ifdef

Not all systems with v4l have ENODATA defined, so check that we have it
before attempting to use it.
Comment 2 Sebastian Dröge (slomo) 2014-01-25 11:32:15 UTC
Comment on attachment 267175 [details] [review]
v4l2: guard use of ENODATA with #ifdef

Is it guaranteed that ENODATA is a #define and not an enum value? Makes sense otherwise
Comment 3 Allison Karlitskaya (desrt) 2014-01-25 17:40:16 UTC
POSIX pretty explicitly states that the errno constants that is mandates must be #ifdef-ible:

All values listed in this section shall be unique integer constant expressions with type int suitable for use in #if preprocessing directives...

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html

Of course, ENODATA is not standard -- but given that POSIX mandates error constants being defines, I think it's pretty reasonable to assume that the non-standard error constants that Linux adds will be as well.
Comment 4 Sebastian Dröge (slomo) 2014-01-25 17:52:10 UTC
Thanks and sorry for being too lazy to look it up myself :)

commit a46f667853fecd34ffbbcfd0920295af930a80b7
Author: Ryan Lortie <desrt@desrt.ca>
Date:   Sat Jan 25 02:06:00 2014 -0500

    v4l2: guard use of ENODATA with #ifdef
    
    Not all systems with v4l have ENODATA defined, so check that we have it
    before attempting to use it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722953