This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Bug in recent java changes
- From: Michael Koch <konqueror at gmx dot de>
- To: Richard dot Earnshaw at arm dot com
- Cc: java-patches at gcc dot gnu dot org
- Date: Wed, 14 May 2003 13:40:18 +0200
- Subject: Re: Bug in recent java changes
- References: <200305140904.h4E94Bj12841@pc960.cambridge.arm.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Mittwoch, 14. Mai 2003 11:04 schrieb Richard Earnshaw:
> > Am Dienstag, 13. Mai 2003 19:59 schrieb Richard Earnshaw:
> > > on an arm-elf cross:
> > >
> > > /home/rearnsha/gnusrc/egcs-cross/libjava/gnu/java/nio/natDirect
> > >Byte BufferIm pl.cc:20: error: prototype
> > > for `jlong
> > > gnu::java::nio::DirectByteBufferImpl::allocateImpl(__java_int
> > > )' does not match any in class
> >
> > Please update, thats already fixed since some hours.
>
> But this one isn't:
>
> java/io/natFileDescriptor.cc: In member function `jint
> java::io::FileDescriptor::open(java::lang::String*,
> __java_int)': java/io/natFileDescriptor.cc:112: error: `O_DSYNC'
> undeclared (first use this
> function)
> java/io/natFileDescriptor.cc:112: error: (Each undeclared
> identifier is reported only once for each function it appears in.)
> java/io/natFileDescriptor.cc: In member function `void
> java::io::FileDescriptor::setLength(__java_long)':
> java/io/natFileDescriptor.cc:203: warning: unused variable `stat
> sb' java/io/natFileDescriptor.cc:202: warning: unused parameter
> `jlong pos' gnumake[4]: *** [java/io/natFileDescriptor.lo] Error 1
> gnumake[4]: *** Waiting for unfinished jobs....
Hmm, I thought newlib users would use natFileDescriptorEcos.cc instead
of natFileDescriptorPosix.cc ....
I have attached a patch for you. Please test it.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+wisjWSOgCCdjSDsRAllwAJ41PCR+tFHS8w16aCd8gCpezXnTnwCgihP9
MBrlEjiqkXmt4bGU7+ZIFcg=
=pSjO
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1895
diff -u -b -B -r1.1895 ChangeLog
--- ChangeLog 14 May 2003 06:37:56 -0000 1.1895
+++ ChangeLog 14 May 2003 11:36:15 -0000
@@ -1,5 +1,10 @@
2003-05-14 Michael Koch <konqueror@gmx.de>
+ * java/io/natFileDescriptorPosix.cc
+ (open): Check if O_DSYNC exist, otherwise use O_SYNC.
+
+2003-05-14 Michael Koch <konqueror@gmx.de>
+
* gnu/java/nio/FileLockImpl.java
(released): New member variable.
(FileLockImpl): Initialize released.
Index: java/io/natFileDescriptorPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natFileDescriptorPosix.cc,v
retrieving revision 1.26
diff -u -b -B -r1.26 natFileDescriptorPosix.cc
--- java/io/natFileDescriptorPosix.cc 13 May 2003 09:13:31 -0000 1.26
+++ java/io/natFileDescriptorPosix.cc 14 May 2003 11:36:15 -0000
@@ -108,8 +108,14 @@
if ((jflags & SYNC))
flags |= O_SYNC;
+#ifdef O_DSYNC
if ((jflags & DSYNC))
flags |= O_DSYNC;
+#else
+ // If O_DSYNC doesnt exist use O_SYNC instead.
+ if ((jflags & DSYNC))
+ flags |= O_SYNC;
+#endif
int fd = ::open (buf, flags, mode);
if (fd == -1 && errno == EMFILE)