1
0
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:
Sebastien Helleu
2007-08-27 13:11:25 +00:00
parent b0490eb249
commit 7f1335c6f0
4 changed files with 20 additions and 10 deletions
+1
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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
View File
@@ -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