[PATCH] Fix stdi_trigger_indication for Pegasus

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1194491086 28800 # Node ID c84928927faf099a7de17ee15321ad7f2574e979 # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 Fix stdi_trigger_indication for Pegasus This fixes (for me) the DefineSystem crash on Pegasus. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 926009fc62a0 -r c84928927faf std_indication.c --- a/std_indication.c Wed Nov 07 08:40:48 2007 -0800 +++ b/std_indication.c Wed Nov 07 19:04:46 2007 -0800 @@ -92,10 +92,30 @@ CMPIStatus stdi_trigger_indication(const CMPIObjectPath *op; CMPIStatus s; const char *method = "TriggerIndications"; + CMPIArgs *in; + CMPIArgs *out; + + in = CMNewArgs(broker, &s); + if (s.rc != CMPI_RC_OK) + return s; + + out = CMNewArgs(broker, &s); + if (s.rc != CMPI_RC_OK) + return s; op = CMNewObjectPath(broker, ns, type, &s); - CBInvokeMethod(broker, context, op, method, NULL, NULL, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Unable to create path for indication %s", + type); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to create path for indication %s", + type); + goto out; + } + CBInvokeMethod(broker, context, op, method, in, out, &s); + out: return s; } @@ -108,21 +128,26 @@ CMPIStatus stdi_raise_indication(const C CMPIObjectPath *op; CMPIStatus s; const char *method = "RaiseIndication"; - CMPIArgs *args; + CMPIArgs *argsin; + CMPIArgs *argsout; op = CMNewObjectPath(broker, ns, type, &s); if (s.rc != CMPI_RC_OK) return s; - args = CMNewArgs(broker, &s); + argsin = CMNewArgs(broker, &s); if (s.rc != CMPI_RC_OK) return s; - s = CMAddArg(args, "Indication", &ind, CMPI_instance); + argsout = CMNewArgs(broker, &s); if (s.rc != CMPI_RC_OK) return s; - CBInvokeMethod(broker, context, op, method, args, NULL, &s); + s = CMAddArg(argsin, "Indication", &ind, CMPI_instance); + if (s.rc != CMPI_RC_OK) + return s; + + CBInvokeMethod(broker, context, op, method, argsin, argsout, &s); return s; }

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1194491086 28800 # Node ID c84928927faf099a7de17ee15321ad7f2574e979 # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 Fix stdi_trigger_indication for Pegasus
This fixes (for me) the DefineSystem crash on Pegasus.
Signed-off-by: Dan Smith <danms@us.ibm.com>
Pegasus doesn't handle the null arguments - nice catch. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1194491086 28800 # Node ID c84928927faf099a7de17ee15321ad7f2574e979 # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 Fix stdi_trigger_indication for Pegasus
This fixes (for me) the DefineSystem crash on Pegasus.
Signed-off-by: Dan Smith <danms@us.ibm.com>
This fixes the VSMS.definesystem crash on Pegasus. +1. -- - Zhengang
participants (3)
-
Dan Smith
-
Kaitlin Rupert
-
Zhengang Li