summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-04-28 22:13:22 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-04-28 22:13:22 (GMT)
commit734aebc39538039c6e81db63edd68eb3a2029cd2 (patch)
treea97a60916799024ba2646e7770ded47320d444c4 /src/H5private.h
parentd3b664b6a79508d78974a347a9d450e72defb76b (diff)
downloadhdf5-734aebc39538039c6e81db63edd68eb3a2029cd2.zip
hdf5-734aebc39538039c6e81db63edd68eb3a2029cd2.tar.gz
hdf5-734aebc39538039c6e81db63edd68eb3a2029cd2.tar.bz2
Rework of the POSIX file open permissions and macros to clean up
HDopen() calls. Also fixed a minor const warning in the core VFD.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/H5private.h b/src/H5private.h
index fc15e99..ca4ebcf 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -495,22 +495,13 @@
# define H5_POSIX_MAX_IO_BYTES SSIZET_MAX
#endif
-/* POSIX I/O mode used as the fourth parameter to open/_open
+/* POSIX I/O mode used as the third parameter to open/_open
* when creating a new file (O_CREAT is set).
- *
- * It's a little awkward to put the Unix file permissions
- * in the symbol name, but that is what is most important
- * and we only need the symbol to handle Windows' less-capable
- * system.
*/
#if defined(H5_HAVE_WIN32_API)
-# define H5_POSIX_OPEN_MODE_0666 (_S_IREAD | _S_IWRITE)
-# define H5_POSIX_OPEN_MODE_0644 _S_IREAD
-# define H5_POSIX_OPEN_MODE_0000 0
+# define H5_POSIX_CREATE_MODE_RW (_S_IREAD | _S_IWRITE)
#else
-# define H5_POSIX_OPEN_MODE_0666 0666
-# define H5_POSIX_OPEN_MODE_0644 0644
-# define H5_POSIX_OPEN_MODE_0000 0000
+# define H5_POSIX_CREATE_MODE_RW 0666
#endif
/*
@@ -1135,11 +1126,7 @@ typedef off_t h5_stat_size_t;
#define HDnanosleep(N, O) nanosleep(N, O)
#endif /* HDnanosleep */
#ifndef HDopen
- #ifdef _O_BINARY
- #define HDopen(S,F,M) open(S,F|_O_BINARY,M)
- #else
- #define HDopen(S,F,M) open(S,F,M)
- #endif
+ #define HDopen(F,...) open(F,__VA_ARGS__)
#endif /* HDopen */
#ifndef HDopendir
#define HDopendir(S) opendir(S)