summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser.c12
-rw-r--r--unwind.h9
2 files changed, 19 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index ddd72fd1..ca9fd3bc 100644
--- a/parser.c
+++ b/parser.c
@@ -1497,14 +1497,22 @@ static mem_t *lino_open(const wchar_t *name_in, lino_file_mode_t mode_in)
{
val name = string(name_in);
val mode = static_str(lino_mode_str[mode_in]);
- return coerce(mem_t *, open_file(name, mode));
+ mem_t *ret = 0;
+ ignerr_begin;
+ ret = coerce(mem_t *, open_file(name, mode));
+ ignerr_end;
+ return ret;
}
static mem_t *lino_open8(const char *name_in, lino_file_mode_t mode_in)
{
val name = string_utf8(name_in);
val mode = static_str(lino_mode_str[mode_in]);
- return coerce(mem_t *, open_file(name, mode));
+ mem_t *ret = 0;
+ ignerr_begin;
+ ret = coerce(mem_t *, open_file(name, mode));
+ ignerr_end;
+ return ret;
}
static mem_t *lino_fdopen(int fd, lino_file_mode_t mode_in)
diff --git a/unwind.h b/unwind.h
index 0a7d20d3..b08f8dc9 100644
--- a/unwind.h
+++ b/unwind.h
@@ -288,3 +288,12 @@ noreturn val type_mismatch(val, ...);
uw_unwind { } \
uw_catch_end; \
return _r_e_t;
+
+#define ignerr_begin \
+ uw_catch_begin (cons(error_s, nil), _x_s_y_m, _x_a_r_g_s)
+
+#define ignerr_end \
+ uw_catch(_x_s_y_m, _x_a_r_g_s) \
+ (void) _x_s_y_m; (void) _x_a_r_g_s; \
+ uw_unwind { } \
+ uw_catch_end