summarylogtreecommitdiffstats
path: root/gdbm-1.15-win32.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gdbm-1.15-win32.patch')
-rw-r--r--gdbm-1.15-win32.patch23
1 files changed, 12 insertions, 11 deletions
diff --git a/gdbm-1.15-win32.patch b/gdbm-1.15-win32.patch
index 2fae94c6529..8057b48f675 100644
--- a/gdbm-1.15-win32.patch
+++ b/gdbm-1.15-win32.patch
@@ -63,7 +63,7 @@ diff -urN gdbm-1.15_orig/compat/dbmopen.c gdbm-1.15/compat/dbmopen.c
if ((mode & GDBM_OPENMASK) == GDBM_READER)
/* Ok, try to cope with it. */
return pagfd;
- else
+ else if (errno != ENOENT)
{
- gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE);
+ gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE);
@@ -458,6 +458,15 @@ diff -urN gdbm-1.15_orig/src/gdbmopen.c gdbm-1.15/src/gdbmopen.c
int *ret_dir_size, int *ret_dir_bits)
{
/* Create the initial hash table directory. */
+@@ -224,7 +224,7 @@
+ return ftruncate (dbf->desc, 0);
+ #else
+ int fd;
+- fd = open (dbf->name, O_RDWR|O_TRUNC, mode);
++ fd = open (dbf->name, O_RDWR|O_TRUNC|O_BINARY, mode);
+ if (fd == -1)
+ return -1;
+ return close (fd);
@@ -355,8 +355,7 @@
if (!(flags & GDBM_CLOERROR))
dbf->desc = -1;
@@ -802,7 +811,7 @@ diff -urN gdbm-1.15_orig/src/systems.h gdbm-1.15/src/systems.h
/* Include all system headers first. */
+#ifdef _WIN32
+# undef _WIN32_WINNT
-+# define _WIN32_WINNT 0x0501
++# define _WIN32_WINNT 0x0601
+# include <windows.h>
+#endif
#include <sys/types.h>
@@ -819,15 +828,7 @@ diff -urN gdbm-1.15_orig/src/systems.h gdbm-1.15/src/systems.h
/* Default block size. Some systems do not have blocksize in their
stat record. This code uses the BSD blocksize from stat. */
-@@ -56,11 +65,14 @@
- #if HAVE_FTRUNCATE
- # define TRUNCATE(dbf) ftruncate (dbf->desc, 0)
- #else
--# define TRUNCATE(dbf) close( open (dbf->name, O_RDWR|O_TRUNC, mode));
-+# define TRUNCATE(dbf) close( open (dbf->name, O_RDWR|O_TRUNC|O_BINARY, mode));
- #endif
-
- #ifndef STDERR_FILENO
+@@ -62,4 +62,7 @@
# define STDERR_FILENO 2
#endif