Re: [Libguestfs] [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins

2017-01-27 Thread Eric Blake
On 01/27/2017 04:11 AM, Richard W.M. Jones wrote: > > Actually OCaml is a real compiled language, and the call from C to > OCaml code (via caml_callback_exn) is a short piece of asm which > preserves errno. Which shows my lack of familiarity with OCaml; but I'm guessing that also means that

Re: [Libguestfs] [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins

2017-01-27 Thread Richard W.M. Jones
On Thu, Jan 26, 2017 at 08:58:34PM -0600, Eric Blake wrote: > diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c > index e2b433e..5d7aeeb 100644 > --- a/plugins/ocaml/ocaml.c > +++ b/plugins/ocaml/ocaml.c > @@ -499,6 +499,17 @@ SET(pwrite) > SET(flush) > SET(trim) > > +/* We can't

[Libguestfs] [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins

2017-01-26 Thread Eric Blake
It is very unlikely that the value of errno after completing the glue code in between the completion of the user's callback and the point in time where we construct the client's reply is going to be untouched, which means that we are likely to send the wrong error code across the wire. Add a new