Changeset: 41f0d9b5b366 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/41f0d9b5b366 Modified Files: common/stream/bs.c common/stream/stream.c Branch: client_interrupts Log Message:
Properly clear errors in streams. diffs (51 lines): diff --git a/common/stream/bs.c b/common/stream/bs.c --- a/common/stream/bs.c +++ b/common/stream/bs.c @@ -372,7 +372,6 @@ block_stream(stream *s) ns->write = bs_write; ns->close = bs_close; ns->destroy = bs_destroy; - ns->clrerr = bs_clrerr; ns->stream_data.p = (void *) b; return ns; diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -654,17 +654,24 @@ mnstr_error_kind_name(mnstr_error_kind k } } -void -mnstr_clearerr(stream *s) + +static void +clearerror(stream *s) { if (s != NULL) { s->errkind = MNSTR_NO__ERROR; s->errmsg[0] = '\0'; - if (s->clrerr) - s->clrerr(s); } } +void +mnstr_clearerr(stream *s) +{ + clearerror(s); + if (s != NULL && s->clrerr) + s->clrerr(s); +} + bool mnstr_isbinary(const stream *s) @@ -750,6 +757,7 @@ create_stream(const char *name) .errkind = MNSTR_NO__ERROR, .errmsg = {0}, .destroy = destroy_stream, + .clrerr = clearerror, }; if(s->name == NULL) { free(s); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org