[konkretcmpi] Support varlist in KReturn2

Radek Novacek rnovacek at fedoraproject.org
Mon Jun 3 09:01:04 UTC 2013


commit bf65f93b4c0d11e3c5adc1b67acc29a3395f17d9
Author: Radek Novacek <rnovacek at redhat.com>
Date:   Mon Jun 3 11:00:51 2013 +0200

    Support varlist in KReturn2
    
    - Resolves: rhbz#969494

 ...retcmpi-0.9.0-support-varlist-in-kreturn2.patch |   45 ++++++++++++++++++++
 konkretcmpi.spec                                   |    8 +++-
 2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/konkretcmpi-0.9.0-support-varlist-in-kreturn2.patch b/konkretcmpi-0.9.0-support-varlist-in-kreturn2.patch
new file mode 100644
index 0000000..706d759
--- /dev/null
+++ b/konkretcmpi-0.9.0-support-varlist-in-kreturn2.patch
@@ -0,0 +1,45 @@
+commit 9729565b5401ec2b7ae0e052c97aec5fa55f0474
+Author: Radek Novacek <rnovacek at redhat.com>
+Date:   Mon Jun 3 10:54:24 2013 +0200
+
+    Support varlist in KReturn2
+    
+    Patch by: Roman Rakus <rrakus at redhat.com>
+
+diff --git a/src/konkret/konkret.h b/src/konkret/konkret.h
+index 417ae56..aed2782 100644
+--- a/src/konkret/konkret.h
++++ b/src/konkret/konkret.h
+@@ -30,6 +30,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdarg.h>
+ 
+ #include <cmpidt.h>
+ #include <cmpift.h>
+@@ -203,12 +204,21 @@ KINLINE void KPutStatus(CMPIStatus* st)
+ KINLINE CMPIStatus __KReturn2(
+     const CMPIBroker* cb, 
+     CMPIrc rc,
+-    const char* msg)
++    const char* format,
++    ...)
+ {
+-    CMReturnWithChars(cb, rc, msg);
++    va_list args;
++    char* str = NULL;
++    va_start(args, format);
++    vasprintf(&str, format, args);
++    va_end(args);
++    CMPIStatus stat={(rc),NULL};
++    stat.msg=cb->eft->newString(cb, str, NULL);
++    free(str);
++    return stat;
+ }
+ 
+-#define KReturn2(CB, CODE, MSG) return __KReturn2(CB, CMPI_RC_##CODE, MSG)
++#define KReturn2(CB, CODE, MSG, ...) return __KReturn2(CB, CMPI_RC_##CODE, MSG, ##__VA_ARGS__)
+ 
+ /*
+ **==============================================================================
diff --git a/konkretcmpi.spec b/konkretcmpi.spec
index 49a3764..37f58f7 100644
--- a/konkretcmpi.spec
+++ b/konkretcmpi.spec
@@ -1,6 +1,6 @@
 Name:           konkretcmpi
 Version:        0.9.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Tool for rapid CMPI providers development
 
 License:        MIT
@@ -17,6 +17,8 @@ Patch0:         konkretcmpi-0.9.0-enable-direct-call.patch
 Patch1:         konkretcmpi-0.9.0-fix-inputoutput-method-arguments.patch
 # Fix return type for generated indication functions
 Patch2:         konkretcmpi-0.9.0-fix-indication-return-type.patch
+# Support varlist in KReturn2
+Patch3:         konkretcmpi-0.9.0-support-varlist-in-kreturn2.patch
 
 %description
 KonkretCMPI makes CMPI provider development easier by generating type-safe 
@@ -83,6 +85,10 @@ rm -rf $RPM_BUILD_ROOT/usr/lib*/libkonkret.la
 
 
 %changelog
+* Mon Jun 03 2013 Radek Novacek <rnovacek at redhat.com> 0.9.0-5
+- Support varlist in KReturn2
+- Resolves: rhbz#969494
+
 * Thu May 09 2013 Radek Novacek <rnovacek at redhat.com> 0.9.0-4
 - Fix return type for generated indication functions
 


More information about the scm-commits mailing list