summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-05-14 14:11:13 +0300
committerunknown <marko@hundin.mysql.fi>2004-05-14 14:11:13 +0300
commit2536d7183d7723eebb750ff4685a6517054da7b9 (patch)
treedfd2b81033e7d96119f6496e8b0caf2876fc3dc8 /innobase
parent1d51406e298ed7e3f6ddb5e239088a03774418ef (diff)
downloadmariadb-git-2536d7183d7723eebb750ff4685a6517054da7b9.tar.gz
InnoDB: Disable file locking on FreeBSD
innobase/os/os0file.c: Disable os_file_lock() on FreeBSD
Diffstat (limited to 'innobase')
-rw-r--r--innobase/os/os0file.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index aad8a911fd5..79185c30f79 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -369,7 +369,16 @@ os_file_handle_error(
return(FALSE);
}
-#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP)
+#undef USE_FILE_LOCK
+#define USE_FILE_LOCK
+#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__)
+/* InnoDB Hot Backup does not lock the data files.
+ * On Windows, mandatory locking is used.
+ * On FreeBSD with LinuxThreads, advisory locking does not work properly.
+ */
+# undef USE_FILE_LOCK
+#endif
+#ifdef USE_FILE_LOCK
/********************************************************************
Obtain an exclusive lock on a file. */
static
@@ -393,7 +402,7 @@ os_file_lock(
}
return 0;
}
-#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */
+#endif /* USE_FILE_LOCK */
/********************************************************************
Does error handling when a file operation fails. */
@@ -852,7 +861,7 @@ try_again:
if (retry) {
goto try_again;
}
-#ifndef UNIV_HOTBACKUP
+#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
*success = FALSE;
file = -1;
@@ -961,7 +970,7 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
-#ifndef UNIV_HOTBACKUP
+#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
*success = FALSE;
file = -1;
@@ -1172,7 +1181,7 @@ try_again:
if (retry) {
goto try_again;
}
-#ifndef UNIV_HOTBACKUP
+#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
*success = FALSE;
file = -1;