1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

make possible to disable flock support

This commit is contained in:
Emmanuel Bouthenot
2006-05-21 12:57:24 +00:00
parent 1c9456f2a7
commit f6bb78a3b2
4 changed files with 54 additions and 2 deletions
+6 -1
View File
@@ -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;
}