diff --git a/ext/hbsdctl.rb/hbsdctl.c b/ext/hbsdctl.rb/hbsdctl.c index ec93208..a7e662b 100644 --- a/ext/hbsdctl.rb/hbsdctl.c +++ b/ext/hbsdctl.rb/hbsdctl.c @@ -43,7 +43,10 @@ feature_set(VALUE self, VALUE path, VALUE state) if (r == 0) { return Qtrue; } else { - return Qfalse; + VALUE rb_mBSD = rb_const_get(rb_cObject, rb_intern("BSD")), + rb_mControl = rb_const_get(rb_mBSD, rb_intern("Control")), + rb_eError = rb_const_get(rb_mControl, rb_intern("Error")); + rb_raise(rb_eError, "hbsdcontrol_set_feature_state failed"); } } diff --git a/lib/bsd/control/feature.rb b/lib/bsd/control/feature.rb index 8185920..335aed5 100644 --- a/lib/bsd/control/feature.rb +++ b/lib/bsd/control/feature.rb @@ -8,10 +8,13 @@ module BSD::Control end ## - # Enables a feature for a given binary. + # Enables a feature for a given executable. # # @param [String] path - # The path to a binary. + # The path to an executable. + # + # @raise [BSD::Control::Error] + # When the operation fails. # # @return [Boolean] # Returns true on success. @@ -20,10 +23,13 @@ module BSD::Control end ## - # Disables a feature for a given binary. + # Disables a feature for a given executable. # # @param [String] path - # The path to a binary. + # The path to an executable. + # + # @raise [BSD::Control::Error] + # When the operation fails. # # @return [Boolean] # Returns true on success.