summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2006-05-21 12:57:24 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2006-05-21 12:57:24 +0000
commitf6bb78a3b27cfe876937454f393fc9b901eec282 (patch)
treec3015ed4eee6b9def5a1fa5a86f453f8f6f29c3d /src/common/log.c
parent1c9456f2a7b80f3ff6da3486df9a8b8ae527a0de (diff)
downloadweechat-f6bb78a3b27cfe876937454f393fc9b901eec282.zip
make possible to disable flock support
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 9774c20ea..edf9d960d 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -71,6 +71,8 @@ weechat_log_open (char *filename, char *mode)
weechat_log_filename = NULL;
return 0;
}
+
+#ifdef HAVE_FLOCK
if ((flock (fileno (weechat_log_file), LOCK_EX | LOCK_NB) != 0))
{
fclose (weechat_log_file);
@@ -79,7 +81,8 @@ weechat_log_open (char *filename, char *mode)
weechat_log_filename = NULL;
return 0;
}
-
+#endif
+
return 1;
}
@@ -154,7 +157,9 @@ weechat_log_close ()
/* close log file */
if (weechat_log_file)
{
+#ifdef HAVE_FLOCK
flock (fileno (weechat_log_file), LOCK_UN);
+#endif
fclose (weechat_log_file);
weechat_log_file = NULL;
}