[PATCH 2/3] Fix properties merge


Ian Bell <IBell@...>
 

From 582a851ec3647df2f5f994833b810a0398aaa070 Mon Sep 17 00:00:00 2001

Message-Id: <582a851ec3647df2f5f994833b810a0398aaa070.1348585382.git.ibell@...>

In-Reply-To: <3c8e82cf69e524a83415677a43c2161d849d10df.1348585382.git.ibell@...>

References: <3c8e82cf69e524a83415677a43c2161d849d10df.1348585382.git.ibell@...>

From: Ian Bell <ibell@...>

Date: Tue, 25 Sep 2012 15:36:06 +0100

Subject: [PATCH 2/3] Fix properties merge

 

Properties set via setproperty before open take priority.

 

Signed-off-by: Ian Bell <ibell@...>

---

mama/c_cpp/src/c/mama.c |   12 ++++++++----

1 file changed, 8 insertions(+), 4 deletions(-)

 

diff --git a/mama/c_cpp/src/c/mama.c b/mama/c_cpp/src/c/mama.c

index f7d2e2c..15a153b 100644

--- a/mama/c_cpp/src/c/mama.c

+++ b/mama/c_cpp/src/c/mama.c

@@ -286,12 +286,14 @@ mamaInternal_loadProperties (const char *path,

     /* We've got file properties, so we need to merge 'em into

      * anything we've already gotten */

-    properties_Merge( gProperties, fileProperties );

+    properties_Merge( fileProperties, gProperties );

     /* Free the file properties, note that FreeEx2 is called to ensure that the data

      * isn't freed as the pointers have been copied over to gProperties.

      */

-    properties_FreeEx2(fileProperties);

+    properties_FreeEx2(gProperties);

+   

+   gProperties =  fileProperties;

}

 static int mamaInternal_statsPublishingEnabled ()

@@ -1067,12 +1069,14 @@ mama_setPropertiesFromFile (const char *path,

     /* We've got file properties, so we need to merge 'em into

      * anything we've already gotten */

-    properties_Merge( gProperties, fileProperties );

+    properties_Merge( fileProperties, gProperties );

     /* Free the file properties, note that FreeEx2 is called to ensure that the data

      * isn't freed as the pointers have been copied over to gProperties.

      */

-    properties_FreeEx2(fileProperties);

+    properties_FreeEx2(gProperties);

+   

+    gProperties = fileProperties;

     return MAMA_STATUS_OK;

}

--

1.7.9.5

 




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.