Mercurial > emacs
changeset 19401:2ada2106a39c
(Fdo_auto_save): If open fails, make lispstream nil.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 17 Aug 1997 23:20:07 +0000 |
parents | 95183e63d1dd |
children | b904f6547598 |
files | src/fileio.c |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Sun Aug 17 01:49:50 1997 +0000 +++ b/src/fileio.c Sun Aug 17 23:20:07 1997 +0000 @@ -4536,12 +4536,16 @@ Lisp_Object listfile; listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); stream = fopen (XSTRING (listfile)->data, "w"); - - /* Arrange to close that file whether or not we get an error. - Also reset auto_saving to 0. */ - lispstream = Fcons (Qnil, Qnil); - XSETFASTINT (XCONS (lispstream)->car, (EMACS_UINT)stream >> 16); - XSETFASTINT (XCONS (lispstream)->cdr, (EMACS_UINT)stream & 0xffff); + if (stream != NULL) + { + /* Arrange to close that file whether or not we get an error. + Also reset auto_saving to 0. */ + lispstream = Fcons (Qnil, Qnil); + XSETFASTINT (XCONS (lispstream)->car, (EMACS_UINT)stream >> 16); + XSETFASTINT (XCONS (lispstream)->cdr, (EMACS_UINT)stream & 0xffff); + } + else + lispstream = Qnil; } else {