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 | |
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.
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | gdbm-win32-support.patch | 24 |
2 files changed, 25 insertions, 1 deletions
@@ -16,7 +16,7 @@ source=("http://ftp.gnu.org/gnu/gdbm/gdbm-${pkgver}.tar.gz" options=('staticlibs' '!buildflags' '!strip') md5sums=('88770493c2559dc80b561293e39d3570' 'ac255b10452005237836cd2d3a470733' - '231f5c2a491af140e916ec1bd4825480') + '47b9d81616ba58b0257248c6a5777412') _architectures="i686-w64-mingw32 x86_64-w64-mingw32" prepare() { 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 + |