mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
Fixed bug with flock() when home is on NFS filesystem (bug #20913)
This commit is contained in:
@@ -5,6 +5,7 @@ ChangeLog - 2007-08-27
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* fixed bug with flock() when home is on NFS filesystem (bug #20913)
|
||||
* added option to align text of messages (except first lines) (task #7246)
|
||||
* fixed user modes in nicklist when ban and nick mode are received in the
|
||||
same MODE message (bug #20870)
|
||||
|
||||
+9
-5
@@ -27,6 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_FLOCK
|
||||
#include <sys/file.h>
|
||||
@@ -79,11 +80,14 @@ weechat_log_open (char *filename, char *mode)
|
||||
#ifdef HAVE_FLOCK
|
||||
if ((flock (fileno (weechat_log_file), LOCK_EX | LOCK_NB) != 0))
|
||||
{
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
if (errno == EWOULDBLOCK)
|
||||
{
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ ChangeLog - 2007-08-27
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* fixed bug with flock() when home is on NFS filesystem (bug #20913)
|
||||
* added option to align text of messages (except first lines) (task #7246)
|
||||
* fixed user modes in nicklist when ban and nick mode are received in the
|
||||
same MODE message (bug #20870)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_FLOCK
|
||||
#include <sys/file.h>
|
||||
@@ -79,11 +80,14 @@ weechat_log_open (char *filename, char *mode)
|
||||
#ifdef HAVE_FLOCK
|
||||
if ((flock (fileno (weechat_log_file), LOCK_EX | LOCK_NB) != 0))
|
||||
{
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
if (errno == EWOULDBLOCK)
|
||||
{
|
||||
fclose (weechat_log_file);
|
||||
weechat_log_file = NULL;
|
||||
free (weechat_log_filename);
|
||||
weechat_log_filename = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user