summaryrefslogtreecommitdiff
path: root/src/udev/v4l_id
Commit message (Collapse)AuthorAgeFilesLines
* udev/v4l_id: use O_CLOEXEC|O_NOCTTYZbigniew Jędrzejewski-Szmek2023-03-161-1/+1
| | | | | | This is the usual set of flags. O_CLOEXEC doesn't matter because we don't spawn anything, but O_NOCTTY could possibly make a difference if the helper is called on a wrong device type.
* udev: implement --version in all builtinsZbigniew Jędrzejewski-Szmek2023-03-161-2/+7
| | | | | | | | | | | | | | | | Those are separate binaries, and occasionally people will get a misplaced binary that doesn't match the rest of the installed system and be confused, so it good to be able to check the version. It is also nice to have the same interface in all binaries. Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option without a short name. We can use a less verbose approach of simply taking any unused letter, which works just as well and even the compiler would warn us if we tried to use the letter in another place. This way we avoid a few lines of boilerplate. The help texts are adjusted to have an empty line between the synopsis and option list, and no empty lines after the option list.
* udev/v4l_id: convert to run() and add error messagesZbigniew Jędrzejewski-Szmek2023-03-131-13/+29
| | | | | Also split out parse_argv(), use "ARG" instead of "<arg>". Make the syntax help a bit more precise.
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+0
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-2/+2
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* license: GPL-2.0+ -> GPL-2.0-or-laterYu Watanabe2020-11-091-1/+1
|
* tree-wide: replace explicit NULL checks with their shorter variantsFrantisek Sumsal2019-04-281-1/+1
| | | | Done by coccinelle/equals-null.cocci
* v4l_id: use device_caps if availableMichael Olbrich2019-02-151-8/+13
| | | | | | | | | | | | | | | | | | | According to the specification[1] the 'capabilities' describe the physical device as a whole and the 'device_caps' describe the current device node. The existence of 'device_caps' is indicated by the V4L2_CAP_DEVICE_CAPS capability flag. Use the 'device_caps' if available to generate the correct ID_V4L_CAPABILITIES for the current device node. This is relevant for UVC devices with current kernels: Two /dev/videoX devices exist for those. One for video and one for metadata. The V4L2_CAP_VIDEO_CAPTURE flag is present in the 'capabilities' for both device nodes but only in the 'device_caps' of the video device node. Without this, the ID_V4L_CAPABILITIES of the metadata device node incorrectly contains 'capture'. [1] https://www.linuxtv.org/downloads/v4l-dvb-apis-new/uapi/v4l/vidioc-querycap.html
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-1/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-141-1/+1
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* v4l_id: check mplane video capture and output capailities (#8464)Jui-Chi Ricky Liang2018-03-201-2/+4
| | | | | Video devices using mplane buffer API declare capture and output capabilities with V4L2_CAP_VIDEO_CAPTURE_MPLANE and V4L2_CAP_VIDEO_OUTPUT_MPLANE.
* Add SPDX license identifiers to source files under the GPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
|
* build-sys: drop automake supportZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | | v2: - also mention m4
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* udev: add emacs header lineZbigniew Jędrzejewski-Szmek2015-12-071-0/+2
| | | | | Otherwise emacs wants to use 2-space indentation and other attrocities.
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-7/+7
| | | | Sort the includes accoding to the new coding style.
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* v4l_id: use standard option parsing loopZbigniew Jędrzejewski-Szmek2015-03-071-10/+9
| | | | | | | Not terribly important, but the loop wasn't an actual loop, making coverity unhappy. CID #1261725.
* build-sys: add two more missing makefile linksLennart Poettering2015-01-061-0/+1
|
* udevadm,..: make --help output of udev tools more like the output of the ↵Lennart Poettering2015-01-051-8/+11
| | | | various other tools
* udev: improve help/usage for some more programsRobert Milasan2015-01-011-1/+1
|
* Remove duplicate includesKarel Zak2013-11-181-4/+0
|
* use the same email address everywhereKay Sievers2012-11-121-1/+1
|
* udev: move all unconditionally installed rules to rules/Kay Sievers2012-04-141-20/+0
|
* move imported udev into placeKay Sievers2012-04-042-0/+107