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:
+6
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user