-/* Copyright (C) 1985-1988, 1990, 1992, 1999-2014 Free Software
+/* Copyright (C) 1985-1988, 1990, 1992, 1999-2015 Free Software
Foundation, Inc.
This file is part of GNU Emacs.
#endif
struct stat stat_buf;
off_t old_file_size;
- int mask;
/* Open the old file, allocate a buffer of the right size, and read
in the file contents. */
the image of the new file. Set pointers to various interesting
objects. */
- new_file = emacs_open (new_name, O_RDWR | O_CREAT, 0666);
+ new_file = emacs_open (new_name, O_RDWR | O_CREAT, 0777);
if (new_file < 0)
fatal ("Can't creat (%s): %s", new_name, strerror (errno));
if (emacs_close (new_file) != 0)
fatal ("Can't close (%s): %s", new_name, strerror (errno));
-
- if (stat (new_name, &stat_buf) != 0)
- fatal ("Can't stat (%s): %s", new_name, strerror (errno));
-
- mask = umask (777);
- umask (mask);
- stat_buf.st_mode |= 0111 & ~mask;
- if (chmod (new_name, stat_buf.st_mode) != 0)
- fatal ("Can't chmod (%s): %s", new_name, strerror (errno));
}