2011-01-07 16:20:45 +01:00
|
|
|
$NetBSD: patch-am,v 1.3 2011/01/07 15:20:45 obache Exp $
|
2009-01-10 22:04:22 +01:00
|
|
|
|
2010-12-27 05:58:10 +01:00
|
|
|
* 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
|
2009-01-10 22:04:22 +01:00
|
|
|
@@ -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;
|
2010-12-27 05:58:10 +01:00
|
|
|
@@ -50,7 +54,7 @@ LIBV4L_PUBLIC int open (const char *file
|
|
|
|
mode_t mode;
|
|
|
|
|
|
|
|
va_start (ap, oflag);
|
|
|
|
- mode = va_arg (ap, mode_t);
|
2011-01-07 16:20:45 +01:00
|
|
|
+ mode = (sizeof (mode_t) < sizeof (int) ? (mode_t)va_arg (ap, int) : va_arg (ap, mode_t));
|
2010-12-27 05:58:10 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
|