diff options
author | Dr. Edscott Wilson Garcia | 2016-05-23 15:56:18 -0500 |
---|---|---|
committer | Dr. Edscott Wilson Garcia | 2016-05-23 15:56:18 -0500 |
commit | 9df70c80a7518c74aad77159b573defbc8e992ef (patch) | |
tree | 129b95760cece47e675c3eec3e5bc55cdac84e62 /gdbm-win32-support.patch | |
parent | f727e79c66495dfa83bc0e2d948b3ed09a523a5f (diff) | |
download | aur-9df70c80a7518c74aad77159b573defbc8e992ef.tar.gz |
Add binary flag for opening/creating file
Windows requires O_BINARY flag, or else will crash on opening or
creating gdbm file.
File lock does not work in windows either, but there you can just
disable the FILE_LOCK flag in the code that calls gdbm.
Diffstat (limited to 'gdbm-win32-support.patch')
-rw-r--r-- | gdbm-win32-support.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdbm-win32-support.patch b/gdbm-win32-support.patch index bc0d5106b1cb..24726d9b8316 100644 --- a/gdbm-win32-support.patch +++ b/gdbm-win32-support.patch @@ -141,3 +141,27 @@ /* Welcome message. */ if (interactive) +--- src/gdbmopen.c.orig 2016-05-20 11:25:15.782413771 -0500 ++++ src/gdbmopen.c 2016-05-20 11:25:32.365583402 -0500 +@@ -128,7 +128,7 @@ + } + else + dbf->cloexec = FALSE; +- ++ fbits |= O_BINARY; + /* Open the file. */ + need_trunc = FALSE; + switch (flags & GDBM_OPENMASK) +--- src/systems.h-orig 2016-05-20 12:13:13.000000000 -0500 ++++ src/systems.h 2016-05-20 12:15:22.406067106 -0500 +@@ -63,7 +63,8 @@ + #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 + |