Skip to contentSkip to conversation

dmeventd: fix dso name wrong compare

PATCH New Lidong Zhong 1 participant 2 messages Jun 26, 2015 – Jul 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmeventd: fix dso name wrong compare

If the dso name is not set in client, then it will be replaced by "-". So the server should compare the dso name with "-" to decide whether it is set.

---
 daemons/dmeventd/dmeventd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
daemons/dmeventd/dmeventd.c +2 -2
index fcfa423..d81c4ee 100644
@@ -1190,12 +1190,12 @@ static int _want_registered_device(char *dso_name, char *device_uuid,
 				   struct thread_status *thread)
 {
 	/* If DSO names and device paths are equal. */
-	if (dso_name && device_uuid)
+	if (strcmp(dso_name,"-") && device_uuid)
 		return !strcmp(dso_name, thread->dso_data->dso_name) &&
 		    !strcmp(device_uuid, thread->device.uuid);
 
 	/* If DSO names are equal. */
-	if (dso_name)
+	if (strcmp(dso_name, "-"))
 		return !strcmp(dso_name, thread->dso_data->dso_name);
 
 	/* If device paths are equal. */
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 dmeventd: fix dso name wrong compare

Hi list,

dmevent_tool won't work without this patch. Could somebody help to review this patch?

Thanks,
Lidong

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 6/26/2015 at 05:16 PM, in message

<[email protected]>, Lidong Zhong

Quoted 27 lines · <[email protected]> wrote:

If the dso name is not set in client, then it will be replaced by "-". So the server should compare the dso name with "-" to decide whether it is set.
---

 daemons/dmeventd/dmeventd.c | 4 ++-- 
 1 file changed, 2 insertions(+), 2 deletions(-) 
daemons/dmeventd/dmeventd.c +2 -2
index fcfa423..d81c4ee 100644 
@@ -1190,12 +1190,12 @@ static int _want_registered_device(char *dso_name,  
 char *device_uuid, 
 				   struct thread_status *thread) 
 { 
 	/* If DSO names and device paths are equal. */ 
-	if (dso_name && device_uuid) 
+	if (strcmp(dso_name,"-") && device_uuid) 
 		return !strcmp(dso_name, thread->dso_data->dso_name) && 
 		    !strcmp(device_uuid, thread->device.uuid); 
 
 	/* If DSO names are equal. */ 
-	if (dso_name) 
+	if (strcmp(dso_name, "-")) 
 		return !strcmp(dso_name, thread->dso_data->dso_name); 
 

/* If device paths are equal. */