aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2005-07-20 14:29:00 +0000
committerKim F. Storm2005-07-20 14:29:00 +0000
commitc04d9e704746e6914389ee11c1ade991f66031d5 (patch)
tree4330d14d13aff2490b9cddad348bf6d093b829f8 /src
parentae6431236dddd1073a8862e456ec520ab178a44c (diff)
downloademacs-c04d9e704746e6914389ee11c1ade991f66031d5.tar.gz
emacs-c04d9e704746e6914389ee11c1ade991f66031d5.zip
(Fload, load_unwind): Use make_save_value to unwind
protect stream.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lread.c b/src/lread.c
index 19c211b096c..cb455ebbb00 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -674,7 +674,6 @@ Return t if file exists. */)
674{ 674{
675 register FILE *stream; 675 register FILE *stream;
676 register int fd = -1; 676 register int fd = -1;
677 register Lisp_Object lispstream;
678 int count = SPECPDL_INDEX (); 677 int count = SPECPDL_INDEX ();
679 Lisp_Object temp; 678 Lisp_Object temp;
680 struct gcpro gcpro1; 679 struct gcpro gcpro1;
@@ -904,10 +903,7 @@ Return t if file exists. */)
904 } 903 }
905 904
906 GCPRO1 (file); 905 GCPRO1 (file);
907 lispstream = Fcons (Qnil, Qnil); 906 record_unwind_protect (load_unwind, make_save_value (stream, 0));
908 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
909 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
910 record_unwind_protect (load_unwind, lispstream);
911 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 907 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
912 specbind (Qload_file_name, found); 908 specbind (Qload_file_name, found);
913 specbind (Qinhibit_file_name_operation, Qnil); 909 specbind (Qinhibit_file_name_operation, Qnil);
@@ -960,8 +956,9 @@ static Lisp_Object
960load_unwind (stream) /* used as unwind-protect function in load */ 956load_unwind (stream) /* used as unwind-protect function in load */
961 Lisp_Object stream; 957 Lisp_Object stream;
962{ 958{
963 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 959 struct Lisp_Save_Value *p = XSAVE_VALUE (stream);
964 | XFASTINT (XCDR (stream)))); 960
961 fclose ((FILE *) p->pointer);
965 if (--load_in_progress < 0) load_in_progress = 0; 962 if (--load_in_progress < 0) load_in_progress = 0;
966 return Qnil; 963 return Qnil;
967} 964}