GNU bug report logs -
#13807
The lock for 'DIR/FILE' should always be 'DIR/.#FILE'.
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sun, 24 Feb 2013 22:51:01 UTC
Severity: wishlist
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 13807 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 04 Mar 2013 18:25:32 -0800
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: monnier <at> iro.umontreal.ca, 13807 <at> debbugs.gnu.org
>
> > This will need a no-op emulation of fchmod for Windows (since a file
> > created here will be world-writable anyway).
>
> OK, thanks. Also, older POSIXish hosts that lack mkstemp won't need
> the fchmod either. I added the following to try to address these two points.
> Revised complete patch attached, relative to trunk bzr 111938.
Thanks, I have 2 more nits.
> + while ((nbytes = readlinkat (AT_FDCWD, lfname, lfinfo, MAX_LFINFO + 1)) < 0
> + && errno == EINVAL)
> {
> - lfinfo[nbytes] = '\0';
> - return build_string (lfinfo);
> + int fd = emacs_open (lfname, O_RDONLY | O_BINARY | O_NOFOLLOW, 0);
> + if (0 <= fd)
> + {
> + ptrdiff_t read_bytes = emacs_read (fd, lfinfo, MAX_LFINFO + 1);
> + int read_errno = errno;
> + if (emacs_close (fd) != 0)
> + return -1;
> + errno = read_errno;
> + return read_bytes;
> + }
> +
> + if (errno != ELOOP)
> + return -1;
We will need to define away O_NOFOLLOW and ELOOP, to get this to
compile on Windows. I think the right place for the former is
nt/inc/unistd.h, near O_NOCTTY, and for the latter nt/inc/ms-w32.h,
where ENOTSUP is defined.
Other than that, I think this is OK. Thanks.
This bug report was last modified 12 years and 83 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.