Mercurial > emacs
comparison src/fileio.c @ 76622:e0b9cd18e1b6
(do_auto_save_unwind): Add BLOCK_INPUT around fclose.
(Fdo_auto_save): Add BLOCK_INPUT around fwrite.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Tue, 20 Mar 2007 08:49:53 +0000 |
parents | 3d45362f1d38 |
children | 0e62a7c60f43 738ce3540ffb c0409ee15cee |
comparison
equal
deleted
inserted
replaced
76621:685fa6c9ae44 | 76622:e0b9cd18e1b6 |
---|---|
5802 Lisp_Object arg; | 5802 Lisp_Object arg; |
5803 { | 5803 { |
5804 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; | 5804 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; |
5805 auto_saving = 0; | 5805 auto_saving = 0; |
5806 if (stream != NULL) | 5806 if (stream != NULL) |
5807 fclose (stream); | 5807 { |
5808 BLOCK_INPUT; | |
5809 fclose (stream); | |
5810 UNBLOCK_INPUT; | |
5811 } | |
5808 return Qnil; | 5812 return Qnil; |
5809 } | 5813 } |
5810 | 5814 |
5811 static Lisp_Object | 5815 static Lisp_Object |
5812 do_auto_save_unwind_1 (value) /* used as unwind-protect function */ | 5816 do_auto_save_unwind_1 (value) /* used as unwind-protect function */ |
5932 in the special file that lists them. For each of these buffers, | 5936 in the special file that lists them. For each of these buffers, |
5933 Record visited name (if any) and auto save name. */ | 5937 Record visited name (if any) and auto save name. */ |
5934 if (STRINGP (b->auto_save_file_name) | 5938 if (STRINGP (b->auto_save_file_name) |
5935 && stream != NULL && do_handled_files == 0) | 5939 && stream != NULL && do_handled_files == 0) |
5936 { | 5940 { |
5941 BLOCK_INPUT; | |
5937 if (!NILP (b->filename)) | 5942 if (!NILP (b->filename)) |
5938 { | 5943 { |
5939 fwrite (SDATA (b->filename), 1, | 5944 fwrite (SDATA (b->filename), 1, |
5940 SBYTES (b->filename), stream); | 5945 SBYTES (b->filename), stream); |
5941 } | 5946 } |
5942 putc ('\n', stream); | 5947 putc ('\n', stream); |
5943 fwrite (SDATA (b->auto_save_file_name), 1, | 5948 fwrite (SDATA (b->auto_save_file_name), 1, |
5944 SBYTES (b->auto_save_file_name), stream); | 5949 SBYTES (b->auto_save_file_name), stream); |
5945 putc ('\n', stream); | 5950 putc ('\n', stream); |
5951 UNBLOCK_INPUT; | |
5946 } | 5952 } |
5947 | 5953 |
5948 if (!NILP (current_only) | 5954 if (!NILP (current_only) |
5949 && b != current_buffer) | 5955 && b != current_buffer) |
5950 continue; | 5956 continue; |