[libcamera-devel] [PATCH 1/2] android: Don't rely on indirect inclusion of unistd.h
paul.elder at ideasonboard.com
paul.elder at ideasonboard.com
Mon May 31 10:50:42 CEST 2021
Hi Laurent,
On Thu, May 27, 2021 at 04:01:48AM +0300, Laurent Pinchart wrote:
> The standard C library close() and lseek() functions require inclusion
> of the unistd.h header. Include it explicitly where needed instead of
> relying on indirect inclusion.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Doesn't regress CTS :)
Tested-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 1 +
> src/android/camera_worker.cpp | 1 +
> src/android/mm/generic_camera_buffer.cpp | 2 ++
> 3 files changed, 4 insertions(+)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 7fc4ddb024c1..81509f57d1b7 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -15,6 +15,7 @@
> #include <fstream>
> #include <sys/mman.h>
> #include <tuple>
> +#include <unistd.h>
> #include <vector>
>
> #include <libcamera/control_ids.h>
> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp
> index 9f727826e23f..98dddd9eb13b 100644
> --- a/src/android/camera_worker.cpp
> +++ b/src/android/camera_worker.cpp
> @@ -10,6 +10,7 @@
> #include <errno.h>
> #include <string.h>
> #include <sys/poll.h>
> +#include <unistd.h>
>
> #include "camera_device.h"
>
> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp
> index 334498c1867f..cca88cf3632f 100644
> --- a/src/android/mm/generic_camera_buffer.cpp
> +++ b/src/android/mm/generic_camera_buffer.cpp
> @@ -7,6 +7,8 @@
>
> #include "../camera_buffer.h"
>
> +#include <unistd.h>
> +
> #include "libcamera/internal/buffer.h"
> #include "libcamera/internal/log.h"
>
> --
> Regards,
>
> Laurent Pinchart
>
More information about the libcamera-devel
mailing list