This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Mutt 1.4-1 opens mbox read-only on Win98


It has been a while since
http://sources.redhat.com/ml/cygwin/2002-07/msg01481.html
and perhaps I have missed the solution to the read-only problem 
on Win98. If so, please disregard the rest.

As a first step I ran the original makemutt from the src package on my
Win98 box. The resulting mutt.exe worked just fine, the read-only
problem was gone.

Comparing the original mutt -v with the new one gave:
/usr/src: diff ~/mutt_old ~/mutt_new
11c11
< -HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  
---
> -HOMESPOOL  -USE_SETGID  -USE_DOTLOCK  -DL_STANDALONE  

It turns out that configure looks at the permissions of the spool/mail
directory to decide the value of USE_DOTLOCK. Sneaky and confusing!

Now why does USE_DOTLOCK cause problem? 
Because dotlock.c contains the line
currdir = open (".", O_RDONLY) 

Here is a test:
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
main()
{
    int currdir;
    currdir = open (".", O_RDONLY);
    printf("Currdir = %d errno %d\n", currdir, errno);
}

~: ./a.exe
Currdir = -1 errno 21

And strace output with cygwin1 from the latest cvs:

 198 1079015 [main] a 35002201 _open: open (., 0x0)
  174 1079189 [main] a 35002201 normalize_posix_path: src .
  187 1079376 [main] a 35002201 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\HOME\Pierre, no-keep-rel, no-add-slash)
  176 1079552 [main] a 35002201 normalize_win32_path: c:\HOME\Pierre =
normalize_win32_path (c:\HOME\Pierre)
  181 1079733 [main] a 35002201 mount_info::conv_to_posix_path:
/c/HOME/Pierre = conv_to_posix_path (c:\HOME\Pierre)
  177 1079910 [main] a 35002201 cwdstuff::get: posix /c/HOME/Pierre
  170 1080080 [main] a 35002201 cwdstuff::get: (/c/HOME/Pierre) =
cwdstuff::get (0x73F84C, 260, 1, 0), errno 0
  176 1080256 [main] a 35002201 normalize_posix_path: /c/HOME/Pierre =
normalize_posix_path (.)
  179 1080435 [main] a 35002201 mount_info::conv_to_win32_path:
conv_to_win32_path (/c/HOME/Pierre)
  174 1080609 [main] a 35002201 mount_info::cygdrive_win32_path: src
'/c/HOME/Pierre', dst 'c:\HOME\Pierre'
  170 1080779 [main] a 35002201 set_flags: flags: binary (0x2)
  168 1080947 [main] a 35002201 mount_info::conv_to_win32_path: src_path
/c/HOME/Pierre, dst c:\HOME\Pierre, flags 0x22, rc 0
  478 1081425 [main] a 35002201 symlink_info::check: not a symlink
  238 1081663 [main] a 35002201 symlink_info::check: 0 = symlink.check
(c:\HOME\Pierre, 0x73F50C) (0x22)
  184 1081847 [main] a 35002201 path_conv::check: root_dir(c:\),
this->path(c:\HOME\Pierre), set_has_acls(0)
  200 1082047 [main] a 35002201 dtable::build_fhandler: fd 3, fh 0x615F3F64
  172 1082219 [main] a 35002201 __set_errno: int
fhandler_disk_file::open(path_conv *, int, int):371 val 21
  185 1082404 [main] a 35002201 fhandler_disk_file::open: 0 =
fhandler_disk_file::open (c:\HOME\Pierre, 0x0)
  185 1082589 [main] a 35002201 _open: -1 = open (., 0x0)

Pierre

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]