File 0001-Use-API-instead-of-internal-data-structure-to-set-pr.patch of Package wsmancli.459

From 1dbc78493e0c39cb022dbf5e86b5719f50b4f512 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Thu, 15 Jan 2015 08:38:51 +0100
Subject: [PATCH 1/3] Use API instead of internal data structure to set
 properties

---
 src/wsman.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/wsman.c b/src/wsman.c
index 78b3689c2a88..7aa6372df214 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -512,25 +512,18 @@ request_usr_pwd( WsManClient *client, wsman_auth_type_t auth,
 
 
 
-static hash_t *wsman_options_get_properties(void)
+static void
+wsman_options_set_properties(client_opt_t *options)
 {
 	int c = 0;
-	hash_t *h = hash_create(HASHCOUNT_T_MAX, 0, 0);
 
 	while (properties != NULL && properties[c] != NULL) {
 		char *cc[3] = { NULL, NULL, NULL };
 		u_tokenize1(cc, 2, properties[c], '=');
-		if (!hash_lookup(h, cc[0])) {
-			if (!hash_alloc_insert(h, cc[0], cc[1])) {
-				debug("hash_alloc_insert failed");
-			}
-		} else {
-			warn("duplicate not added to hash");
-		}
-
+                wsmc_add_property(options, cc[0], cc[1]);
 		c++;
 	}
-	return h;
+	return;
 }
 
 
@@ -745,7 +738,7 @@ int main(int argc, char **argv)
 		options->fragment = fragment;
 	}
 
-	options->properties = wsman_options_get_properties();
+	wsman_options_set_properties(options);
 	options->cim_ns = cim_namespace;
 	if (cim_extensions) {
 		wsmc_set_action_option(options, FLAG_CIM_EXTENSIONS);
-- 
2.1.4

openSUSE Build Service is sponsored by