irssi on cygwin: log locked
"Damjan Lango" <[email protected]> Mon, 8 Oct 2007 18:51:22 +0200
| Newsgroups | gmane.network.irc.irssi.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_14208_14050898.1191862283011
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello!
I'm using irssi on cygwin and it works great, I just have a little nuisance
with the log files - I can't read them while irssi is running, while if i
remember correctly on unix it was possbile to read the logs while irssi was
running.
So i tried removing the following pieces of code:
#ifdef HAVE_FCNTL
memset(&lock, 0, sizeof(lock));
lock.l_type = F_WRLCK;
if (fcntl(log->handle, F_SETLK, &lock) == -1 && errno == EACCES) {
close(log->handle);
log->handle = -1;
signal_emit("log locked", 1, log);
log->failed = TRUE;
return FALSE;
}
#endif
#ifdef HAVE_FCNTL
memset(&lock, 0, sizeof(lock));
lock.l_type = F_UNLCK;
fcntl(log->handle, F_SETLK, &lock);
#endif
and now it works ok.
So, I have a question, what other implications are there if I remove this
code?
Should this be made into a configurable option, or, are there other more
appropriate options for locking that would allow for it to work under cygwin
better? Or maybe is cygwin's locking too strict as it seems to me that only
write lock is used...
any hint?
------=_Part_14208_14050898.1191862283011
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello!<br><br>I'm using irssi on cygwin and it works great, I just have a little nuisance with the log files - I can't read them while irssi is running, while if i remember correctly on unix it was possbile to read the logs while irssi was running.
<br>So i tried removing the following pieces of code:<br><br>#ifdef HAVE_FCNTL<br> memset(&lock, 0, sizeof(lock));<br> lock.l_type = F_WRLCK;<br> if (fcntl(log->handle, F_SETLK, &lock) == -1 && errno == EACCES) {
<br> close(log->handle);<br> log->handle = -1;<br> signal_emit("log locked", 1, log);<br> log->failed = TRUE;<br> return FALSE;
<br> }<br>#endif<br><br>#ifdef HAVE_FCNTL<br> memset(&lock, 0, sizeof(lock));<br> lock.l_type = F_UNLCK;<br> fcntl(log->handle, F_SETLK, &lock);<br>#endif<br><br>and now it works ok.
<br>So, I have a question, what other implications are there if I remove this code?<br>Should this be made into a configurable option, or, are there other more appropriate options for locking that would allow for it to work under cygwin better? Or maybe is cygwin's locking too strict as it seems to me that only write lock is used...
<br>any hint?<br><br><br><br>
------=_Part_14208_14050898.1191862283011--