diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-12-06 14:48:16 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-12-07 19:09:22 +0200 |
commit | 72679c682eb0b9f03948f258a26f78c037d33c48 (patch) | |
tree | dab82bec75e56a349f38bca5ffd2c78dc0e5a20a /test/ipa/ipa_interface_test.cpp | |
parent | 37c41aa6a69985f99f9540dc89d094df61770fdc (diff) |
libcamera: base: shared_fd: Don't dup() an invalid fd
The SharedFD::dup() implementation calls the C library dup() function on
the fd. When the SharedFD instance is invalid, this produces an invalid
fd, which is the correct behaviour, but logs an error message.
Fix it by returning an invalid UniqueFD directly when the SharedFD is
invalid. This also saves a system call, which is always nice to do.
Fixes: fcf98514cb4e ("libcamera: base: file_descriptor: Return UniqueFD from dup()")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'test/ipa/ipa_interface_test.cpp')
0 files changed, 0 insertions, 0 deletions