summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-06 16:34:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-06 16:34:30 -0800
commit2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0 (patch)
tree6493a6d6fcc6654a25570a1f623a0d2c7436dece /lib.c
parent3d38f312065003330f2f9c6f504f0e634ba2a5b6 (diff)
downloadtxr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.tar.gz
txr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.tar.bz2
txr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.zip
Throw exception on stream error during close, or I/O operations. This
is needed for pipes that terminate abnormally or return failed termination. Pipe and stdio streams have an extra description field so they are printed in a readable way.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index aa17a7a5..635ab8d4 100644
--- a/lib.c
+++ b/lib.c
@@ -53,7 +53,7 @@ obj_t *define, *output, *single, *frst, *lst, *empty, *repeat, *rep;
obj_t *flattn, *forget, *local, *mrge, *bind, *cat, *args;
obj_t *try, *catch, *finally, *nothrow, *throw, *defex;
obj_t *error, *type_error, *internal_err, *numeric_err, *range_err;
-obj_t *query_error, *file_error;
+obj_t *query_error, *file_error, *process_error;
obj_t *zero, *one, *two, *negone, *maxint, *minint;
obj_t *null_string;
@@ -1338,7 +1338,7 @@ static obj_t *lazy_stream_func(obj_t *env, obj_t *lcons)
lcons->lc.func = nil;
if (!next || !ahead)
- close_stream(stream);
+ close_stream(stream, t);
if (ahead)
push(ahead, cdr_l(env));
@@ -1351,7 +1351,7 @@ obj_t *lazy_stream_cons(obj_t *stream)
obj_t *first = get_line(stream);
if (!first) {
- close_stream(stream);
+ close_stream(stream, t);
return nil;
}
@@ -1753,6 +1753,7 @@ static void obj_init(void)
range_err = intern(string("range_error"));
query_error = intern(string("query_error"));
file_error = intern(string("file_error"));
+ process_error = intern(string("process_error"));
interned_syms = cons(nil, interned_syms);