]> xenbits.xensource.com Git - xen.git/commit
ocaml/xenctrl: Make failwith_xc() thread safe
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Jan 2015 17:55:32 +0000 (17:55 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 27 May 2015 16:04:03 +0000 (17:04 +0100)
commit032673c8836e28d9e291e0d02235001c41aedaab
tree992d167e4f859ec77c3067bdc65772d51aac9ceb
parentc91ed889ea3c3781a94a30909f30c3aad56c97d5
ocaml/xenctrl: Make failwith_xc() thread safe

The static error_str[] buffer is not thread-safe, and 1024 bytes is
unreasonably large.  Reduce to 256 bytes (which is still much larger than any
current use), and move it to being a stack variable.

Also, propagate the Noreturn attribute from caml_raise_with_string().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Dave Scott <Dave.Scott@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
(cherry picked from commit c8945d51613450c19e0898b1b3056c90f4929179)
tools/ocaml/libs/xc/xenctrl_stubs.c