search for: exception_happened

Displaying 4 results from an estimated 4 matches for "exception_happened".

2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...handle, uint32_t count, uint64_t offset) } static int +plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim) +{ + volatile VALUE argv[4]; + + argv[0] = (VALUE) handle; + argv[1] = ULL2NUM (count); + argv[2] = ULL2NUM (offset); + argv[3] = may_trim ? Qtrue : Qfalse; + exception_happened = 0; + last_error = 0; + (void) funcall2 (Qnil, rb_intern ("zero"), 4, argv); + if (last_error == EOPNOTSUPP || + exception_happened == EXCEPTION_NO_METHOD_ERROR) { + nbdkit_debug ("zero falling back to pwrite"); + nbdkit_set_error (EOPNOTSUPP); + return -1; +...
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering that this is the first time I've every tried to run Ruby). I even had fun making set_error() polymorphic. Eric Blake (2): ruby: Expose nbdkit_set_error to ruby script ruby: Support zero callback plugins/ruby/example.rb | 11 ++++++++ plugins/ruby/nbdkit-ruby-plugin.pod | 54
2019 Aug 13
0
[nbdkit PATCH 2/2] plugins: Permit ENOTSUP as synonym for EOPNOTSUPP
...6a4e..ff7932c4 100644 --- a/plugins/ruby/ruby.c +++ b/plugins/ruby/ruby.c @@ -420,7 +420,7 @@ plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim) argv[3] = may_trim ? Qtrue : Qfalse; last_error = 0; (void) funcall2 (Qnil, rb_intern ("zero"), 4, argv, &exception_happened); - if (last_error == EOPNOTSUPP || + if (last_error == EOPNOTSUPP || last_error == ENOTSUP || exception_happened == EXCEPTION_NO_METHOD_ERROR) { nbdkit_debug ("zero falling back to pwrite"); nbdkit_set_error (EOPNOTSUPP); diff --git a/server/plugins.c b/server/plugins....
2019 Aug 13
3
[nbdkit PATCH 0/2] errno cleanup patches
I ran into these while trying to prepare patches to add NBD_CMD_FLAG_FAST_ZERO, which will expose a new NBD_ENOTSUP wire value. Eric Blake (2): plugins: Don't lose original error when emulating FUA plugins: Permit ENOTSUP as synonym for EOPNOTSUPP docs/nbdkit-filter.pod | 11 ++++++----- docs/nbdkit-plugin.pod | 12 +++++++----- plugins/file/file.c | 16 +++++++++++-----