diff --git a/ext/hbsdctl.rb/feature.c b/ext/hbsdctl.rb/feature.c index 35a1469..1295da9 100644 --- a/ext/hbsdctl.rb/feature.c +++ b/ext/hbsdctl.rb/feature.c @@ -20,6 +20,7 @@ feature_set(VALUE self, VALUE rb_path, VALUE rb_state) static VALUE __set(VALUE rb_path, VALUE rb_feature, VALUE rb_state) { + errno = 0; int result = hbsdcontrol_set_feature_state( RSTRING_PTR(rb_path), RSTRING_PTR(rb_feature), diff --git a/ext/hbsdctl.rb/ffi.c b/ext/hbsdctl.rb/ffi.c index c3326c9..8645af3 100644 --- a/ext/hbsdctl.rb/ffi.c +++ b/ext/hbsdctl.rb/ffi.c @@ -73,6 +73,7 @@ ffi_status(VALUE self, VALUE rb_feature, VALUE rb_path) char enable_data[2], disable_data[2]; int ns; + errno = 0; options = __options_init(rb_feature, rb_path); if (extattr_string_to_namespace("system", &ns) == -1) { rb_syserr_fail(errno, "extattr_string_to_namespace");