From 43414cda327cbdf37f4e6e43468d39982a4bca50 Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Fri, 29 Nov 2024 19:50:10 +0000 Subject: [PATCH] catch one --- src/aio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/aio.c b/src/aio.c index e45352477..2a64ad925 100644 --- a/src/aio.c +++ b/src/aio.c @@ -198,10 +198,11 @@ SEXP rnng_aio_get_msg(SEXP env) { break; default: - break; + res = 0; + return mk_error_aio(res, env); } - SEXP out, result; + SEXP out, pipe; unsigned char *buf; size_t sz; @@ -215,9 +216,9 @@ SEXP rnng_aio_get_msg(SEXP env) { } PROTECT(out = nano_decode(buf, sz, raio->mode, NANO_PROT(aio))); - PROTECT(result = Rf_ScalarInteger(-res)); + PROTECT(pipe = Rf_ScalarInteger(-res)); Rf_defineVar(nano_ValueSymbol, out, env); - Rf_defineVar(nano_AioSymbol, result, env); + Rf_defineVar(nano_AioSymbol, pipe, env); UNPROTECT(2); return out;