dc

[hare] Tiny reverse polish desk calculator
Log | Files | Refs | README | LICENSE

commit 8ceb910df45458ad9590c403d85cbcbd9312f664
parent f437c515b43132ed75b0689c63ffcee192f142ed
Author: Byron Torres <b@torresjrjr.com>
Date:   Fri, 24 Jun 2022 02:14:38 +0100

handle io::close errors

Diffstat:
Mdc.ha | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dc.ha b/dc.ha @@ -39,7 +39,7 @@ export fn main() void = { case let err: fs::error => fmt::fatal("dc: {} '{}'", fs::strerror(err), filename); }; - defer io::close(file); + defer io::close(file)!; const in = bufio::buffered(file, buf, []); match (dc(&in)) { @@ -117,10 +117,10 @@ fn dc(in: *bufio::bufstream) (void | io::error) = { os::exec::addfile(&cmd, pipe.1, os::stdout_file); const proc = os::exec::start(&cmd)!; //TODO - io::close(pipe.1); + io::close(pipe.1)!; let data = io::drain(pipe.0); - io::close(pipe.0); + io::close(pipe.0)!; const status = os::exec::wait(&proc); // printing