Bug with sync(), fsync() detection
Archie Cobbs
archie at whistle.com
Thu Aug 13 18:23:05 PDT 1998
The configure process fails to properly detect the sync() and fsync()
library calls, which causes spurious SyncFailedException's from the
java.io.FileDescriptor.sync() method. The patch below fixes this.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
Index: ChangeLog
===================================================================
RCS file: /cvs/mod/net/kaffe/ChangeLog,v
retrieving revision 1.1.1.6.2.14
diff -c -u -r1.1.1.6.2.14 ChangeLog
--- ChangeLog 1998/08/12 16:32:57 1.1.1.6.2.14
+++ ChangeLog 1998/08/14 01:19:35
@@ -1,3 +1,8 @@
+Thu Aug 13 18:17:51 1998 Archie Cobbs <archie at whistle.com>
+
+ * config/config.h.in, libraries/clib/native/FileDescriptor.c:
+ uppercase options HAVE_sync and HAVE_fsync
+
Mon Aug 10 19:58:36 1998 Alexandre Oliva <oliva at dcc.unicamp.br>
* kaffe/kaffevm/jni.c (Kaffe_JNI_wrapper): call installMethodCode
Index: config/config.h.in
===================================================================
RCS file: /cvs/mod/net/kaffe/config/config.h.in,v
retrieving revision 1.1.1.6.2.2
diff -c -u -r1.1.1.6.2.2 config.h.in
--- config.h.in 1998/08/07 17:41:22 1.1.1.6.2.2
+++ config.h.in 1998/08/14 01:19:40
@@ -269,10 +269,10 @@
#undef HAVE_KILL
/* Do we have sync */
-#undef HAVE_sync
+#undef HAVE_SYNC
/* Do we have fsync */
-#undef HAVE_fsync
+#undef HAVE_FSYNC
/* Do we have atexit */
#undef HAVE_ATEXIT
Index: libraries/clib/native/FileDescriptor.c
===================================================================
RCS file: /cvs/mod/net/kaffe/libraries/clib/native/FileDescriptor.c,v
retrieving revision 1.1.1.1
diff -c -u -r1.1.1.1 FileDescriptor.c
--- FileDescriptor.c 1998/07/10 23:01:02 1.1.1.1
+++ FileDescriptor.c 1998/08/14 01:19:41
@@ -11,6 +11,7 @@
#include "config.h"
#include "config-std.h"
#include "config-io.h"
+#include "files.h"
#include "FileDescriptor.h"
#include "jsyscall.h"
#include "../../../kaffe/kaffevm/support.h"
@@ -45,14 +46,14 @@
void
java_io_FileDescriptor_sync(struct Hjava_io_FileDescriptor* this)
{
-#if defined(HAVE_fsync)
+#if defined(HAVE_FSYNC)
if (unhand(this)->fd >= 0) {
int r = fsync(unhand(this)->fd);
if (r < 0) {
SignalError("java.io.SyncFailedException", SYS_ERROR);
}
}
-#elif defined(HAVE_sync)
+#elif defined(HAVE_SYNC)
/* Fallback on a full sync */
sync();
#else
More information about the kaffe
mailing list