SDL: v4l2: return success if the device is ready

From 11129761e7e37a354db06a99aaca8c592fd9f57d Mon Sep 17 00:00:00 2001
From: Green Sky <[EMAIL REDACTED]>
Date: Tue, 17 Sep 2024 13:20:42 +0200
Subject: [PATCH] v4l2: return success if the device is ready

---
 src/camera/v4l2/SDL_camera_v4l2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/camera/v4l2/SDL_camera_v4l2.c b/src/camera/v4l2/SDL_camera_v4l2.c
index 819ea1455a902..e755bff89e43c 100644
--- a/src/camera/v4l2/SDL_camera_v4l2.c
+++ b/src/camera/v4l2/SDL_camera_v4l2.c
@@ -107,6 +107,8 @@ static bool V4L2_WaitDevice(SDL_Camera *device)
         rc = select(fd + 1, &fds, NULL, NULL, &tv);
         if ((rc == -1) && (errno == EINTR)) {
             rc = 0;  // pretend it was a timeout, keep looping.
+        } else if (rc > 0) {
+            return true;
         }
 
         // Thread is requested to shut down