Hi,
The final argument of fcntl is a long, but cpnio_fcntl took an int. This
patch fixes that and makes sure it is always used with a long argument.
2006-09-17 Mark Wielaard <[EMAIL PROTECTED]>
* native/jni/java-nio/javanio.c (cpnio_fcntl): Last argument is long.
* native/jni/java-nio/javanio.h (cpnio_fcntl): Likewise.
* native/jni/java-nio/gnu_java_nio_VMChannel.c
(Java_gnu_java_nio_VMChannel_lock): Likewise.
(Java_gnu_java_nio_VMChannel_unlock): Likewise.
This fixes the build with -Werror enabled on GNU/Linux x86_64.
Committed,
Mark
Index: native/jni/java-nio/gnu_java_nio_VMChannel.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,v
retrieving revision 1.3
diff -u -r1.3 gnu_java_nio_VMChannel.c
--- native/jni/java-nio/gnu_java_nio_VMChannel.c 17 Sep 2006 07:31:43 -0000 1.3
+++ native/jni/java-nio/gnu_java_nio_VMChannel.c 17 Sep 2006 22:36:16 -0000
@@ -1587,7 +1587,7 @@
fl.l_type = (shared ? F_RDLCK : F_WRLCK);
fl.l_whence = SEEK_SET;
- if (cpnio_fcntl (fd, (wait ? F_SETLKW : F_SETLK), (int) &fl) == -1)
+ if (cpnio_fcntl (fd, (wait ? F_SETLKW : F_SETLK), (long) &fl) == -1)
{
if (errno != EAGAIN)
JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
@@ -1620,7 +1620,7 @@
fl.l_type = F_UNLCK;
fl.l_whence = SEEK_SET;
- if (cpnio_fcntl (fd, F_SETLK, (int) &fl) == -1)
+ if (cpnio_fcntl (fd, F_SETLK, (long) &fl) == -1)
{
JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
}
Index: native/jni/java-nio/javanio.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/javanio.c,v
retrieving revision 1.1
diff -u -r1.1 javanio.c
--- native/jni/java-nio/javanio.c 17 Sep 2006 07:31:43 -0000 1.1
+++ native/jni/java-nio/javanio.c 17 Sep 2006 22:36:16 -0000
@@ -104,7 +104,7 @@
}
extern inline int
-cpnio_fcntl (int fd, int cmd, int arg)
+cpnio_fcntl (int fd, int cmd, long arg)
{
#ifdef HAVE_FCNTL
return fcntl (fd, cmd, arg);
Index: native/jni/java-nio/javanio.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/javanio.h,v
retrieving revision 1.1
diff -u -r1.1 javanio.h
--- native/jni/java-nio/javanio.h 17 Sep 2006 07:31:43 -0000 1.1
+++ native/jni/java-nio/javanio.h 17 Sep 2006 22:36:16 -0000
@@ -297,7 +297,7 @@
* Allowed ERRNO values:
* FIXME
*/
-CPNIO_EXPORT int cpnio_fcntl (int fd, int cmd, int arg);
+CPNIO_EXPORT int cpnio_fcntl (int fd, int cmd, long arg);
/**