pkgsrc/graphics/libv4l/patches/patch-am

37 lines
908 B
Text
Raw Normal View History

$NetBSD: patch-am,v 1.3 2011/01/07 15:20:45 obache Exp $
* XXXX
* `mode_t' is promoted to `int' when passed through `...'.
--- libv4l1/v4l1compat.c.orig 2008-08-26 12:32:39.000000000 +0000
+++ libv4l1/v4l1compat.c
@@ -40,6 +40,10 @@
#define LIBV4L_PUBLIC
#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
LIBV4L_PUBLIC int open (const char *file, int oflag, ...)
{
int fd;
@@ -50,7 +54,7 @@ LIBV4L_PUBLIC int open (const char *file
mode_t mode;
va_start (ap, oflag);
- mode = va_arg (ap, mode_t);
+ mode = (sizeof (mode_t) < sizeof (int) ? (mode_t)va_arg (ap, int) : va_arg (ap, mode_t));
fd = v4l1_open(file, oflag, mode);
@@ -71,7 +75,7 @@ LIBV4L_PUBLIC int open64 (const char *fi
mode_t mode;
va_start (ap, oflag);
- mode = va_arg (ap, mode_t);
+ mode = (mode_t)va_arg (ap, int);
fd = v4l1_open(file, oflag | O_LARGEFILE, mode);