android: camera_stream: Include <poll.h> instead of <sys/poll.h>
diff mbox series

Message ID 20260212152850.3743004-1-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • android: camera_stream: Include <poll.h> instead of <sys/poll.h>
Related show

Commit Message

Laurent Pinchart Feb. 12, 2026, 3:28 p.m. UTC
The standard C library header for the poll() API is poll.h, not
sys/poll.h. The musl C library warns about this:

In file included from src/android/camera_stream.cpp:13:
host/i586-buildroot-linux-musl/sysroot/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Fix it by including the correct header.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/android/camera_stream.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 1dcf9957a47fb54fce4fbae9daec0b587e52562e

Comments

Kieran Bingham Feb. 12, 2026, 3:55 p.m. UTC | #1
Quoting Laurent Pinchart (2026-02-12 15:28:50)
> The standard C library header for the poll() API is poll.h, not
> sys/poll.h. The musl C library warns about this:
> 
> In file included from src/android/camera_stream.cpp:13:
> host/i586-buildroot-linux-musl/sysroot/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
>     1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
>       |  ^~~~~~~
> 
> Fix it by including the correct header.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/android/camera_stream.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index 1d68540d7e50..7da01dc30031 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -8,9 +8,9 @@
>  #include "camera_stream.h"
>  
>  #include <errno.h>
> +#include <poll.h>

Looks sane,


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>  #include <string.h>
>  #include <sys/mman.h>
> -#include <sys/poll.h>
>  #include <unistd.h>
>  
>  #include <libcamera/formats.h>
> 
> base-commit: 1dcf9957a47fb54fce4fbae9daec0b587e52562e
> -- 
> Regards,
> 
> Laurent Pinchart
>
Barnabás Pőcze Feb. 12, 2026, 3:56 p.m. UTC | #2
2026. 02. 12. 16:28 keltezéssel, Laurent Pinchart írta:
> The standard C library header for the poll() API is poll.h, not
> sys/poll.h. The musl C library warns about this:
> 
> In file included from src/android/camera_stream.cpp:13:
> host/i586-buildroot-linux-musl/sysroot/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
>      1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
>        |  ^~~~~~~
> 
> Fix it by including the correct header.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   src/android/camera_stream.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index 1d68540d7e50..7da01dc30031 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -8,9 +8,9 @@
>   #include "camera_stream.h"
>   
>   #include <errno.h>
> +#include <poll.h>
>   #include <string.h>
>   #include <sys/mman.h>
> -#include <sys/poll.h>
>   #include <unistd.h>
>   
>   #include <libcamera/formats.h>
> 
> base-commit: 1dcf9957a47fb54fce4fbae9daec0b587e52562e

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index 1d68540d7e50..7da01dc30031 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -8,9 +8,9 @@ 
 #include "camera_stream.h"
 
 #include <errno.h>
+#include <poll.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/poll.h>
 #include <unistd.h>
 
 #include <libcamera/formats.h>