diff options
author | Greg Lewis <glewis@FreeBSD.org> | 2004-10-16 16:58:12 +0000 |
---|---|---|
committer | Greg Lewis <glewis@FreeBSD.org> | 2004-10-16 16:58:12 +0000 |
commit | 4e95ec3207baf01a5b668e01aacae0143fa56d49 (patch) | |
tree | d357fd142efed4a75d70cc9d42b02c53921817e2 /java | |
parent | 4c02adff5922b72efe2eccb266a86daeebd4ac4f (diff) | |
download | ports-4e95ec3207baf01a5b668e01aacae0143fa56d49.tar.gz ports-4e95ec3207baf01a5b668e01aacae0143fa56d49.zip |
. At least on FreeBSD, O_SYNC and O_DSYNC aren't both defined
(for FreeBSD 4.x neither are defined and for FreeBSD 5.x
O_DSYNC isn't defined). This caused them to be defined to
some bogus values. In particular, O_SYNC would be defined
as 0x800, which is O_EXCL (at least on FreeBSD 4.x). The
result being that the RandomAccessFile class would fail to
open an existing file if you specified "s" as part of the mode.
Fix this by defining O_SYNC and O_DSYNC to O_FSYNC if they
aren't defined.
Notes
Notes:
svn path=/head/; revision=119604
Diffstat (limited to 'java')
-rw-r--r-- | java/jdk14/files/patch-io_io_util.h | 21 | ||||
-rw-r--r-- | java/jdk15/files/patch-io_io_util.h | 21 | ||||
-rw-r--r-- | java/jdk16/files/patch-io_io_util.h | 21 |
3 files changed, 63 insertions, 0 deletions
diff --git a/java/jdk14/files/patch-io_io_util.h b/java/jdk14/files/patch-io_io_util.h new file mode 100644 index 000000000000..80f00417aa2b --- /dev/null +++ b/java/jdk14/files/patch-io_io_util.h @@ -0,0 +1,21 @@ +$FreeBSD$ + +--- ../../j2se/src/share/native/java/io/io_util.h.orig Wed Jul 21 08:32:49 2004 ++++ ../../j2se/src/share/native/java/io/io_util.h Wed Jul 21 08:37:54 2004 +@@ -10,7 +10,15 @@ + + extern jfieldID IO_fd_fdID; + +-#if !defined(O_DSYNC) || !defined(O_SYNC) ++#ifdef _BSD_SOURCE ++#include <fcntl.h> ++#ifndef O_SYNC ++#define O_SYNC O_FSYNC ++#endif ++#ifndef O_DSYNC ++#define O_DSYNC O_FSYNC ++#endif ++#elif !defined(O_DSYNC) || !defined(O_SYNC) + #define O_SYNC (0x0800) + #define O_DSYNC (0x2000) + #endif diff --git a/java/jdk15/files/patch-io_io_util.h b/java/jdk15/files/patch-io_io_util.h new file mode 100644 index 000000000000..80f00417aa2b --- /dev/null +++ b/java/jdk15/files/patch-io_io_util.h @@ -0,0 +1,21 @@ +$FreeBSD$ + +--- ../../j2se/src/share/native/java/io/io_util.h.orig Wed Jul 21 08:32:49 2004 ++++ ../../j2se/src/share/native/java/io/io_util.h Wed Jul 21 08:37:54 2004 +@@ -10,7 +10,15 @@ + + extern jfieldID IO_fd_fdID; + +-#if !defined(O_DSYNC) || !defined(O_SYNC) ++#ifdef _BSD_SOURCE ++#include <fcntl.h> ++#ifndef O_SYNC ++#define O_SYNC O_FSYNC ++#endif ++#ifndef O_DSYNC ++#define O_DSYNC O_FSYNC ++#endif ++#elif !defined(O_DSYNC) || !defined(O_SYNC) + #define O_SYNC (0x0800) + #define O_DSYNC (0x2000) + #endif diff --git a/java/jdk16/files/patch-io_io_util.h b/java/jdk16/files/patch-io_io_util.h new file mode 100644 index 000000000000..80f00417aa2b --- /dev/null +++ b/java/jdk16/files/patch-io_io_util.h @@ -0,0 +1,21 @@ +$FreeBSD$ + +--- ../../j2se/src/share/native/java/io/io_util.h.orig Wed Jul 21 08:32:49 2004 ++++ ../../j2se/src/share/native/java/io/io_util.h Wed Jul 21 08:37:54 2004 +@@ -10,7 +10,15 @@ + + extern jfieldID IO_fd_fdID; + +-#if !defined(O_DSYNC) || !defined(O_SYNC) ++#ifdef _BSD_SOURCE ++#include <fcntl.h> ++#ifndef O_SYNC ++#define O_SYNC O_FSYNC ++#endif ++#ifndef O_DSYNC ++#define O_DSYNC O_FSYNC ++#endif ++#elif !defined(O_DSYNC) || !defined(O_SYNC) + #define O_SYNC (0x0800) + #define O_DSYNC (0x2000) + #endif |