From: Paul Eggert Date: Wed, 20 Jun 2012 21:20:06 +0000 (-0700) Subject: * fileio.c (Fdefault_file_modes): Block input while fiddling with umask. X-Git-Tag: emacs-24.2.90~1199^2~417 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f10deafb12a12daa85f8357a73752765549969c0;p=emacs.git * fileio.c (Fdefault_file_modes): Block input while fiddling with umask. Otherwise, the umask might be mistakenly 0 while handling input signals. --- diff --git a/src/ChangeLog b/src/ChangeLog index ba523de1e39..69f11e5a614 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-06-20 Paul Eggert + + * 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 * minibuf.c (Fread_string): Bind minibuffer-completion-table. diff --git a/src/fileio.c b/src/fileio.c index 388ae84b6f3..8b69ed5eae4 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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;