libcamera: media_device: Ignore lockf() return value

When `_FORTIFY_SOURCE` is enabled, the `lockf()` function might be marked
with the `warn_unused_result` attribute, leading to compilation failure.
Fix that by explicitly ignoring the return value.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze 2025-03-17 17:45:02 +01:00
parent bb7f702b48
commit fbb67a73c4

View file

@ -13,6 +13,7 @@
#include <string>
#include <string.h>
#include <sys/ioctl.h>
#include <tuple>
#include <unistd.h>
#include <vector>
@ -164,7 +165,7 @@ void MediaDevice::unlock()
if (!fd_.isValid())
return;
lockf(fd_.get(), F_ULOCK, 0);
std::ignore = lockf(fd_.get(), F_ULOCK, 0);
}
/**