v4l2gl/v4l2grab: fix errno assignment in while loop
authorAndreas Weber <andreas.weber@hs-offenburg.de>
Thu, 16 Jan 2014 17:43:31 +0000 (18:43 +0100)
committerHans Verkuil <hans.verkuil@cisco.com>
Fri, 17 Jan 2014 18:48:01 +0000 (19:48 +0100)
Signed-off-by: Andreas Weber <andy.weber.aw@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
contrib/test/v4l2gl.c
contrib/test/v4l2grab.c

index e921212..4b549c1 100644 (file)
@@ -224,7 +224,7 @@ static int capture(char *dev_name, int x_res, int y_res, int n_frames,
                        tv.tv_usec = 0;
 
                        r = select(fd + 1, &fds, NULL, NULL, &tv);
-               } while ((r == -1 && (errno = EINTR)));
+               } while ((r == -1 && (errno == EINTR)));
                if (r == -1) {
                        perror("select");
                        return errno;
index a93ad43..14d2a8f 100644 (file)
@@ -129,7 +129,7 @@ static int capture(char *dev_name, int x_res, int y_res, int n_frames,
                        tv.tv_usec = 0;
 
                        r = select(fd + 1, &fds, NULL, NULL, &tv);
-               } while ((r == -1 && (errno = EINTR)));
+               } while ((r == -1 && (errno == EINTR)));
                if (r == -1) {
                        perror("select");
                        return errno;