Source: sqlite3
Version: 3.7.9-2
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
sqlite3 3.7.8-1 basically disables patch 20-hurd-locking-style.patch
(which makes sqlite3 use the flock style for file locking on Hurd),
making sqlite3 use the POSIX style locking, which is broken on Hurd.
Attached there is a new patch for flock file locking on Hurd, which
replaces the current(ly disabled) 20-hurd-locking-style.patch.
Thanks,
--
Pino
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -123,7 +123,7 @@
#include <sys/mman.h>
#endif
-#if SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
# include <sys/ioctl.h>
# if OS_VXWORKS
# include <semaphore.h>
@@ -2052,7 +2052,7 @@
** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off or if
** compiling for VXWORKS.
*/
-#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
+#if (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) || defined(__GNU__)
/*
** Retry flock() calls that fail with EINTR
@@ -4309,7 +4309,7 @@
dotlockCheckReservedLock /* xCheckReservedLock method */
)
-#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
+#if (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) || defined(__GNU__)
IOMETHODS(
flockIoFinder, /* Finder function name */
flockIoMethods, /* sqlite3_io_methods object name */
@@ -6726,6 +6726,8 @@
static sqlite3_vfs aVfs[] = {
#if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
UNIXVFS("unix", autolockIoFinder ),
+#elif defined(__GNU__)
+ UNIXVFS("unix", flockIoFinder ),
#else
UNIXVFS("unix", posixIoFinder ),
#endif