* fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Jun 2012 21:20:06 +0000 (14:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Jun 2012 21:20:06 +0000 (14:20 -0700)
Otherwise, the umask might be mistakenly 0 while handling input signals.

src/ChangeLog
src/fileio.c

index ba523de..69f11e5 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
+       Otherwise, the umask might be mistakenly 0 while handling input signals.
+
 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuf.c (Fread_string): Bind minibuffer-completion-table.
index 388ae84..8b69ed5 100644 (file)
@@ -3014,8 +3014,10 @@ The value is an integer.  */)
   int realmask;
   Lisp_Object value;
 
+  BLOCK_INPUT;
   realmask = umask (0);
   umask (realmask);
+  UNBLOCK_INPUT;
 
   XSETINT (value, (~ realmask) & 0777);
   return value;