aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-02-28 00:03:58 +0100
committerJoakim Verona2013-02-28 00:03:58 +0100
commitaa1ff60c7bba6f944522ca2f75f688c1323bdb39 (patch)
tree5c0c026c93d5334104c0282e4b2c86fe281cb18a /src
parent96fd57d9873b5c150e2632e5a1f60a78fac65aa8 (diff)
parent531e70eca4c3bcd44942a67f5ea1a8bb1cb41dad (diff)
downloademacs-aa1ff60c7bba6f944522ca2f75f688c1323bdb39.tar.gz
emacs-aa1ff60c7bba6f944522ca2f75f688c1323bdb39.zip
auto upstream
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/callint.c2
-rw-r--r--src/filelock.c14
-rw-r--r--src/lisp.h3
-rw-r--r--src/macros.c2
5 files changed, 26 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e3112a26af..4135dadf28a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
12013-02-27 Eli Zaretskii <eliz@gnu.org>
2
3 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
4 _SH_DENYRW flag, instead of emacs_open, to deny any other process
5 access to the lock file until it is written and closed.
6 (Bug#13807)
7
82013-02-27 Paul Eggert <eggert@cs.ucla.edu>
9
10 * callint.c (Qcall_interactively):
11 * macros.c (Qexecute_kbd_macro):
12 Now static.
13
12013-02-26 Bastien Guerry <bzg@gnu.org> 142013-02-26 Bastien Guerry <bzg@gnu.org>
2 15
3 * window.c (Frecenter): Tiny docstring enhancement. 16 * window.c (Frecenter): Tiny docstring enhancement.
diff --git a/src/callint.c b/src/callint.c
index b0d4bcdd011..212dd2e3d62 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#include "keymap.h" 29#include "keymap.h"
30 30
31Lisp_Object Qminus, Qplus; 31Lisp_Object Qminus, Qplus;
32Lisp_Object Qcall_interactively; 32static Lisp_Object Qcall_interactively;
33static Lisp_Object Qcommand_debug_status; 33static Lisp_Object Qcommand_debug_status;
34static Lisp_Object Qenable_recursive_minibuffers; 34static Lisp_Object Qenable_recursive_minibuffers;
35 35
diff --git a/src/filelock.c b/src/filelock.c
index 4d556de2454..78cd60a12e1 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -44,6 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include "coding.h" 44#include "coding.h"
45#include "systime.h" 45#include "systime.h"
46#ifdef WINDOWSNT 46#ifdef WINDOWSNT
47#include <share.h>
47#include "w32.h" /* for dostounix_filename */ 48#include "w32.h" /* for dostounix_filename */
48#endif 49#endif
49 50
@@ -353,12 +354,17 @@ create_lock_file (char *lfname, char *lock_info_str, bool force)
353 create a regular file with the lock info written as its 354 create a regular file with the lock info written as its
354 contents. */ 355 contents. */
355 { 356 {
356 int fd = emacs_open (lfname, O_WRONLY | O_BINARY | O_CREAT | O_EXCL, 357 /* Deny everybody else any kind of access to the file until we are
357 S_IREAD | S_IWRITE); 358 done writing it and close the handle. This makes the entire
359 open/write/close operation atomic, as far as other processes
360 are concerned. */
361 int fd = _sopen (lfname,
362 _O_WRONLY | _O_BINARY | _O_CREAT | _O_EXCL | _O_NOINHERIT,
363 _SH_DENYRW, S_IREAD | S_IWRITE);
358 364
359 if (fd < 0 && errno == EEXIST && force) 365 if (fd < 0 && errno == EEXIST && force)
360 fd = emacs_open (lfname, O_WRONLY | O_BINARY | O_TRUNC, 366 fd = _sopen (lfname, _O_WRONLY | _O_BINARY | _O_TRUNC |_O_NOINHERIT,
361 S_IREAD | S_IWRITE); 367 _SH_DENYRW, S_IREAD | S_IWRITE);
362 if (fd >= 0) 368 if (fd >= 0)
363 { 369 {
364 ssize_t lock_info_len = strlen (lock_info_str); 370 ssize_t lock_info_len = strlen (lock_info_str);
diff --git a/src/lisp.h b/src/lisp.h
index 7b36878c0c5..3d018b2b45e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3371,7 +3371,7 @@ extern void syms_of_minibuf (void);
3371 3371
3372extern Lisp_Object Qminus, Qplus; 3372extern Lisp_Object Qminus, Qplus;
3373extern Lisp_Object Qwhen; 3373extern Lisp_Object Qwhen;
3374extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; 3374extern Lisp_Object Qmouse_leave_buffer_hook;
3375extern void syms_of_callint (void); 3375extern void syms_of_callint (void);
3376 3376
3377/* Defined in casefiddle.c. */ 3377/* Defined in casefiddle.c. */
@@ -3532,7 +3532,6 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object,
3532 Lisp_Object, ptrdiff_t, Lisp_Object *); 3532 Lisp_Object, ptrdiff_t, Lisp_Object *);
3533 3533
3534/* Defined in macros.c. */ 3534/* Defined in macros.c. */
3535extern Lisp_Object Qexecute_kbd_macro;
3536extern void init_macros (void); 3535extern void init_macros (void);
3537extern void syms_of_macros (void); 3536extern void syms_of_macros (void);
3538 3537
diff --git a/src/macros.c b/src/macros.c
index 0dcfbe5532c..48d23a977b1 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include "window.h" 28#include "window.h"
29#include "keyboard.h" 29#include "keyboard.h"
30 30
31Lisp_Object Qexecute_kbd_macro; 31static Lisp_Object Qexecute_kbd_macro;
32static Lisp_Object Qkbd_macro_termination_hook; 32static Lisp_Object Qkbd_macro_termination_hook;
33 33
34/* Number of successful iterations so far 34/* Number of successful iterations so far