From 6d92fc29ea20ec203e282b2fc850a9c064360c44 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Tue, 25 Aug 2009 17:44:37 +0100 Subject: [PATCH] if the lib return a negative value propagate the exception upwards --- libs/xc/xc_stubs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/xc/xc_stubs.c b/libs/xc/xc_stubs.c index 7ff73f2..dcb1a1a 100644 --- a/libs/xc/xc_stubs.c +++ b/libs/xc/xc_stubs.c @@ -1153,9 +1153,13 @@ CAMLprim value stub_xc_domain_send_s3resume(value handle, value domid) CAMLprim value stub_xc_domain_get_acpi_s_state(value handle, value domid) { CAMLparam2(handle, domid); - int state; - state = xc_domain_get_acpi_s_state(_H(handle), _D(domid)); - CAMLreturn(Val_int(state)); + int ret; + + ret = xc_domain_get_acpi_s_state(_H(handle), _D(domid)); + if (ret < 0) + failwith_xc(); + + CAMLreturn(Val_int(ret)); } /* -- 2.39.5