Hallo Martin,

Martin Neitzel <[email protected]> wrote:
 |Since I updated s-nail's master branch 10 days ago (after the
 |"Albatross" announcment), s-nail felt unable to lock (and hence update)
 |my /var/mail/$USER spool file.  (A classic, local, single mbox-style
 |nail spool.)
 |
 |Upon "q"uitting, there is actually an error msg stating "could not lock
 |/var/mail/neitzel" or something similar, but I didn't see these parting
 |words earlier because I usually run s-nail in its own (screen(1)) window.
 |At any rate, after 10 days it was obvious that the spool file only
 |kept growing.  D'oh.
 |
 |A brutal
 |
 | git revert 328d46ab8f4ce78f28c9c58efba77a5b7717e887
 |
 |fixed that again.  I tried to pinpoint the fault but wasn't
 |able to do so by mere inspection of the 328d46ab commit diff.

Thanks for reporting this issue!
It seems i was inwardly crying about not having a mutt_dotlock(1)
available when i did that, falsely assigning true to true and
reversing another return value in exactly the same way!
Instead you now should (with *debug* a.k.a. -d) see something like

  Creating dot lock for "/var/mail/steffen"
  Can't manage lock files in "/var/mail/steffen", please check permissions
  Saved 1 message in mbox
  Held 8 messages in /var/mail/steffen

Would you be so kind and confirm this?
The fix is on the [master] branch as well as attached.
Thanks!

--steffen
commit 7f8ebc0 (refs/remotes/origin/next, refs/remotes/origin/master, refs/heads/next, refs/heads/master)
Author: Steffen (Daode) Nurpmeso <[email protected]>
Date:   2015-06-29 13:52:34 +0200

    dotlock.c:_dot_dir_access(): fix return value (Martin Neitzel)..
    
    It seems that during the rewrite i changed the control flow twice,
    and did not carefully enough adjust the return value accordingly,
    effectively setting a true value to true again instead of
    assigning false in the other case, and another similar case.
---
 dotlock.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dotlock.c b/dotlock.c
index df81fd7..43a1cbc 100644
--- a/dotlock.c
+++ b/dotlock.c
@@ -125,11 +125,12 @@ _dot_dir_access(char const *fname)
 
    if ((rv = is_dir(path))) {
       for (;;)
-         if (!access(path, R_OK | W_OK | X_OK)) {
-            rv = TRU1;
+         if (!access(path, R_OK | W_OK | X_OK))
             break;
-         } else if (errno != EINTR)
+         else if (errno != EINTR) {
+            rv = FAL0;
             break;
+         }
    }
 
    ac_free(path);
@@ -328,7 +329,7 @@ dot_lock(char const *fname, int fd, size_t pollmsecs)
       rv = (create_exclusive(path) == 0);
       olderrno = errno;
       sigprocmask(SIG_SETMASK, &oset, NULL);
-      if (!rv)
+      if (rv)
          goto jleave;
 
       while (!_dot_fcntl_lock(fd, FLOCK_UNLOCK))
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users

Reply via email to