nmh-workers
[Top] [All Lists]

[Nmh-workers] Changes to allow nmh 1.3 to work on VFAT (or other non-linking FS)

2008-07-08 04:24:12
Hi all,

Thanks for the work on nmh.  I have been using it for years via mh-e.
With the simple changes below, nmh running under GNU/LINUX is able to
work with a Mail directory tree stored on a VFAT partition.  I think the
changes are minor enough not to mess anything else up.  Everything seems
to work, but honestly I am not [n]mh expert enough to test everything.
So as always, "no promises," and "hope it's useful."

jpm

-- 
Jeff Morgenthaler, Ph.D.
Research Scientist
Planetary Science Institute
PO Box 230 Fort Kent Mills, ME 04744-0230
Phone: 207-834-3595
FAX: 207-834-3598
jpmorgen(_at_)psi(_dot_)edu
http://alum.mit.edu/www/jpmorgen




cd /usr/share/JPM_ENV/src/nmh-1.3/sbr/
diff -c /usr/share/JPM_ENV/src/nmh-1.3/sbr/folder_addmsg.c\~ 
/usr/share/JPM_ENV/src/nmh-1.3/sbr/folder_addmsg.c
*** /usr/share/JPM_ENV/src/nmh-1.3/sbr/folder_addmsg.c~ 2007-03-20 
20:21:10.000000000 -0400
--- /usr/share/JPM_ENV/src/nmh-1.3/sbr/folder_addmsg.c  2008-07-03 
14:32:36.000000000 -0400
***************
*** 174,184 ****
  
            /*
             * If link failed because we are trying to link
!            * across devices, then check if there is a message
             * already in the desired location.  If so, then return
             * error, else just copy the message.
             */
!           if (linkerr == EXDEV) {
                if (stat (newmsg, &st1) == 0) {
                    advise (NULL, "message %s:%s already exists", mp->foldpath, 
newmsg);
                    return -1;
--- 174,185 ----
  
            /*
             * If link failed because we are trying to link
!            * across devices, or not suppoted by the filesystem
!            * then check if there is a message
             * already in the desired location.  If so, then return
             * error, else just copy the message.
             */
!           if (linkerr == EXDEV || linkerr == EPERM) {
                if (stat (newmsg, &st1) == 0) {
                    advise (NULL, "message %s:%s already exists", mp->foldpath, 
newmsg);
                    return -1;

Diff finished at Thu Jul  3 14:33:18

cd /usr/share/JPM_ENV/src/nmh-1.3/sbr/
diff -c /usr/share/JPM_ENV/src/nmh-1.3/sbr/lock_file.c\~ 
/usr/share/JPM_ENV/src/nmh-1.3/sbr/lock_file.c
*** /usr/share/JPM_ENV/src/nmh-1.3/sbr/lock_file.c~     2008-04-05 
14:41:37.000000000 -0400
--- /usr/share/JPM_ENV/src/nmh-1.3/sbr/lock_file.c      2008-07-03 
14:31:08.000000000 -0400
***************
*** 462,467 ****
--- 462,470 ----
       * by linking to the temporary file.
       */
      fd = link(tmplock, curlock);
+     /* Check for failure on vfat or other non-linking systems */
+     if (errno == EPERM)
+       fd = creat(curlock, 0600);    
      unlink(tmplock);
  
      return (fd == -1 ? -1 : 0);

Diff finished at Thu Jul  3 14:34:45


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>