comparison src/lstream.c @ 219:262b8bb4a523 r20-4b8

Import from CVS: tag r20-4b8
author cvs
date Mon, 13 Aug 2007 10:09:35 +0200
parents e45d5e7c476e
children f955c73f5258
comparison
equal deleted inserted replaced
218:c9f226976f56 219:262b8bb4a523
184 Lstream_pseudo_close (lstr); 184 Lstream_pseudo_close (lstr);
185 return; 185 return;
186 } 186 }
187 #endif 187 #endif
188 if (lstr->flags & LSTREAM_FL_IS_OPEN) 188 if (lstr->flags & LSTREAM_FL_IS_OPEN)
189 Lstream_close (lstr); 189 {
190 if (for_disksave)
191 {
192 if (lstr->flags & LSTREAM_FL_CLOSE_AT_DISKSAVE)
193 Lstream_close (lstr);
194 }
195 else
196 /* Just close. */
197 Lstream_close (lstr);
198 }
190 } 199 }
191 200
192 static unsigned int 201 static unsigned int
193 sizeof_lstream (CONST void *header) 202 sizeof_lstream (CONST void *header)
194 { 203 {
823 Lisp_Object obj = Qnil; 832 Lisp_Object obj = Qnil;
824 Lstream *lstr = Lstream_new (lstream_stdio, mode); 833 Lstream *lstr = Lstream_new (lstream_stdio, mode);
825 struct stdio_stream *str = STDIO_STREAM_DATA (lstr); 834 struct stdio_stream *str = STDIO_STREAM_DATA (lstr);
826 str->file = stream; 835 str->file = stream;
827 str->closing = flags & LSTR_CLOSING; 836 str->closing = flags & LSTR_CLOSING;
837 lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
828 XSETLSTREAM (obj, lstr); 838 XSETLSTREAM (obj, lstr);
829 return obj; 839 return obj;
830 } 840 }
831 841
832 Lisp_Object 842 Lisp_Object
954 fstr->current_pos = fstr->starting_pos; 964 fstr->current_pos = fstr->starting_pos;
955 if (count < 0) 965 if (count < 0)
956 fstr->end_pos = -1; 966 fstr->end_pos = -1;
957 else 967 else
958 fstr->end_pos = fstr->starting_pos + count; 968 fstr->end_pos = fstr->starting_pos + count;
969 lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
959 XSETLSTREAM (obj, lstr); 970 XSETLSTREAM (obj, lstr);
960 return obj; 971 return obj;
961 } 972 }
962 973
963 Lisp_Object 974 Lisp_Object