Hi,

Andrew and Christian pointed out that the way we fiddle with umask is 1)
not-thread-safe and 2) unnecessary. So this patch fixes that up. It also
removes the linking against libclasspathnative for the nio library since
it doesn't actually uses that (it uses javanio.h).

2007-03-28  Mark Wielaard  <[EMAIL PROTECTED]>

        * native/jni/java-nio/Makefile.am (LIBADD): Don't add
        libclasspathnative.
        * native/jni/java-nio/gnu_java_nio_VMChannel.c
        (Java_gnu_java_nio_VMChannel_open): Don't set and reset umask.

Committed,

Mark
Index: native/jni/java-nio/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/Makefile.am,v
retrieving revision 1.28
diff -u -r1.28 Makefile.am
--- native/jni/java-nio/Makefile.am	6 Nov 2006 00:19:43 -0000	1.28
+++ native/jni/java-nio/Makefile.am	28 Mar 2007 09:47:35 -0000
@@ -12,7 +12,6 @@
 			javanio.h
 
 libjavanio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
-		       $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
 		       $(LTLIBICONV) 
 
 # Directly included through javanio.h
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.15
diff -u -r1.15 gnu_java_nio_VMChannel.c
--- native/jni/java-nio/gnu_java_nio_VMChannel.c	28 Jan 2007 13:32:33 -0000	1.15
+++ native/jni/java-nio/gnu_java_nio_VMChannel.c	28 Mar 2007 09:47:35 -0000
@@ -1,5 +1,5 @@
 /* gnu_java_nio_VMChannel.c -
-   Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -1609,8 +1609,6 @@
   int nmode = 0;
   int ret;
   const char *npath;
-  mode_t mask = umask (0);
-  umask (mask);
 
   if ((mode & CPNIO_READ) && (mode & CPNIO_WRITE))
     nmode = O_RDWR;
@@ -1630,7 +1628,7 @@
 
 /*   NIODBG("path: %s; mode: %x", npath, nmode); */
 
-  ret = open (npath, nmode, 0777 & ~mask);
+  ret = open (npath, nmode, 0666);
 
 /*   NIODBG("ret: %d\n", ret); */
 

Reply via email to