From c88d5afb108ac631f24e41cfa261a570496e95fc Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Wed, 20 Mar 2024 17:24:10 -0300 Subject: [PATCH] Raise rb_eSystemCallError in case errno has not been set --- ext/hbsdctl.rb/feature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/hbsdctl.rb/feature.c b/ext/hbsdctl.rb/feature.c index b32c723..2322e17 100644 --- a/ext/hbsdctl.rb/feature.c +++ b/ext/hbsdctl.rb/feature.c @@ -25,7 +25,7 @@ bsdcontrol_feature_status(VALUE self, VALUE path) if (feature->hf_get(ctx, feature, &fd, &state) == RES_FAIL) { close(fd); - errno == 0 ? rb_raise(rb_eRuntimeError, "hf_get") + errno == 0 ? rb_raise(rb_eSystemCallError, "hf_get") : rb_syserr_fail(errno, "hf_get"); } else @@ -57,7 +57,7 @@ bsdcontrol_feature_set(VALUE self, VALUE path, VALUE rbstate) if (feature->hf_apply(ctx, feature, &fd, &state) == RES_FAIL) { close(fd); - errno == 0 ? rb_raise(rb_eRuntimeError, "hf_apply") + errno == 0 ? rb_raise(rb_eSystemCallError, "hf_apply") : rb_syserr_fail(errno, "hf_apply"); } else