[gnu.emacs.bug] filelock.c - No fchmod

kayvan@APPLE.COM (Kayvan Sylvan) (12/02/88)

In GNU Emacs 18.52.5 of Thu Dec  1 1988 on satyr (usg-unix-v)

In filelock.c, fchmod is used in two places. If CLASH_DETECTION is
turned on for Unix SysV systems, temacs will not be loaded.

Here's a simple fix for this problem:

*** filelock.c~	Thu Dec  1 15:24:45 1988
--- filelock.c	Thu Dec  1 15:24:45 1988
***************
*** 149,153 ****
--- 149,157 ----
    if ((fd = open (lfname, mode, 0666)) >= 0)
      {
+ #ifdef USG
+       chmod (lfname, 0666);
+ #else
        fchmod (fd, 0666);
+ #endif
        sprintf (buf, "%d ", getpid ());
        write (fd, buf, strlen (buf));
***************
*** 252,256 ****
--- 256,264 ----
    if (fd >= 0)
      {
+ #ifdef USG
+       chmod (PATH_SUPERLOCK, 0666);
+ #else
        fchmod (fd, 0666);
+ #endif
        write (fd, lfname, strlen (lfname));
        close (fd);