Skip to contentSkip to conversation

Revert "guest agent: remove g_strcmp0 usage"

PATCH Applied Markus Armbruster 4 participants 6 messages May 27, 2015 – Jul 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "guest agent: remove g_strcmp0 usage"

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1.

Conflicts:
qemu-ga.c

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 9939a2b..0b788e1 100644
@@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 
     level &= G_LOG_LEVEL_MASK;
 #ifndef _WIN32
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
 #else
Signature · 1 line
1.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Markus Armbruster

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1.

Conflicts:
qemu-ga.c

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +0 -0
index 9939a2b..0b788e1 100644

qga/main.c static void ga_log(const gchar *domain, GLogLevelFlags level, · line 280

Quoted 8 lines
qga/main.c +1 -1
@@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 
     level &= G_LOG_LEVEL_MASK;
 #ifndef _WIN32
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
 #else
#2 lore raw
In reply to Markus Armbruster

Ping?

Quoted 26 lines · Markus Armbruster

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1.

Conflicts:
qemu-ga.c

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 9939a2b..0b788e1 100644
@@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 
     level &= G_LOG_LEVEL_MASK;
 #ifndef _WIN32
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
 #else
#3 lore raw

Falling back to qemu-trivial, hope that's okay.

Quoted 30 lines · Markus Armbruster

Ping?

Quoted 26 lines · Markus Armbruster

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1.

Conflicts:
qemu-ga.c

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 9939a2b..0b788e1 100644
@@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 
     level &= G_LOG_LEVEL_MASK;
 #ifndef _WIN32
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
 #else
Applied
#4 lore raw
In reply to Markus Armbruster

Quoting Markus Armbruster (2015-06-16 01:34:57)

Quoted 1 line

Ping?

Applied, thanks.

Quoted 30 lines
Quoted 26 lines · Markus Armbruster

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1.

Conflicts:
qemu-ga.c

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 9939a2b..0b788e1 100644
@@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 
     level &= G_LOG_LEVEL_MASK;
 #ifndef _WIN32
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
 #else
#5 lore raw
In reply to Markus Armbruster

qga/main.c static void ga_log(const gchar *domain, GLogLevelFlags level, · line 277

Quoted 7 lines · Markus Armbruster

Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore.

 qga/main.c | 2 +-
qga/main.c +1 -1
-    if (domain && strcmp(domain, "syslog") == 0) {
+    if (g_strcmp0(domain, "syslog") == 0) {

Why bother? To me the current version is easier to read, it is traditional and working, while for g_strcmp0() I have to look up documentation.

/mjt