diff options
-rw-r--r-- | stream.c | 6 | ||||
-rw-r--r-- | strudel.c | 2 | ||||
-rw-r--r-- | txr.1 | 6 |
3 files changed, 7 insertions, 7 deletions
@@ -978,7 +978,7 @@ static val stdio_close(val stream, val throw_on_error) if (h->f != 0 && h->f != stdin && h->f != stdout && h->f != stderr) { int result = fclose(h->f); h->f = 0; - if (result == EOF && throw_on_error) { + if (result == EOF && default_null_arg(throw_on_error)) { h->err = num(errno); uw_throwf(file_error_s, lit("error closing ~s: ~d/~s"), stream, num(errno), errno_to_str(errno), nao); @@ -1378,7 +1378,7 @@ static val pipe_close(val stream, val throw_on_error) stream, num(errno), errno_to_str(errno), nao); } else { #if HAVE_SYS_WAIT - if (throw_on_error) { + if (default_null_arg(throw_on_error)) { if (WIFSIGNALED(status)) { int termsig = WTERMSIG(status); uw_throwf(process_error_s, lit("pipe ~s terminated by signal ~a"), @@ -1397,7 +1397,7 @@ static val pipe_close(val stream, val throw_on_error) return num(exitstatus); } #else - if (status != 0 && throw_on_error) + if (status != 0 && default_null_arg(throw_on_error)) uw_throwf(process_error_s, lit("closing pipe ~s failed"), stream, nao); #endif return status == 0 ? zero : nil; @@ -145,7 +145,7 @@ static val strudel_close(val stream, val throw_on_error) struct strudel_base *sb = coerce(struct strudel_base *, stream->co.handle); val obj = sb->obj; val meth = slot(obj, close_s); - return funcall2(meth, obj, throw_on_error); + return funcall2(meth, obj, default_null_arg(throw_on_error)); } static val strudel_flush(val stream) @@ -60159,7 +60159,7 @@ invocation. .coNP Method @ close .synb -.mets << stream .(close offs whence) +.mets << stream .(close throw-on-error-p) .syne .desc The @@ -60311,8 +60311,8 @@ stream I/O function. .mets \ \ \ \ (put-buf buf pos me.stream)) .mets \ \ (:method fill-buf (me buf pos) .mets \ \ \ \ (fill-buf buf pos me.stream)) -.mets \ \ (:method close (me) -.mets \ \ \ \ (close-stream me.stream)) +.mets \ \ (:method close (me throw-on-error) +.mets \ \ \ \ (close-stream me.stream throw-on-error)) .mets \ \ (:method flush (me) .mets \ \ \ \ (flush-stream me.stream)) .mets \ \ (:method seek (me offs whence) |