Patchwork [1/2] guest agent: remove g_strcmp0 usage

login
register
mail settings
Submitter Michael Roth
Date Aug. 11, 2011, 8:38 p.m.
Message ID <1313095092-25092-1-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/109683/
State New
Headers show

Comments

Michael Roth - Aug. 11, 2011, 8:38 p.m.
g_strcmp0 isn't in all version of glib 2.0, so don't use it to avoid
build breakage on older distros.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qemu-ga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Anthony Liguori - Aug. 22, 2011, 2:42 p.m.
On 08/11/2011 03:38 PM, Michael Roth wrote:
> g_strcmp0 isn't in all version of glib 2.0, so don't use it to avoid
> build breakage on older distros.
>
> Signed-off-by: Michael Roth<mdroth@linux.vnet.ibm.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   qemu-ga.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-ga.c b/qemu-ga.c
> index 869ee37..e6ccc21 100644
> --- a/qemu-ga.c
> +++ b/qemu-ga.c
> @@ -146,7 +146,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
>       }
>
>       level&= G_LOG_LEVEL_MASK;
> -    if (g_strcmp0(domain, "syslog") == 0) {
> +    if (domain&&  strcmp(domain, "syslog") == 0) {
>           syslog(LOG_INFO, "%s: %s", level_str, msg);
>       } else if (level&  s->log_level) {
>           g_get_current_time(&time);

Patch

diff --git a/qemu-ga.c b/qemu-ga.c
index 869ee37..e6ccc21 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -146,7 +146,7 @@  static void ga_log(const gchar *domain, GLogLevelFlags level,
     }
 
     level &= G_LOG_LEVEL_MASK;
-    if (g_strcmp0(domain, "syslog") == 0) {
+    if (domain && strcmp(domain, "syslog") == 0) {
         syslog(LOG_INFO, "%s: %s", level_str, msg);
     } else if (level & s->log_level) {
         g_get_current_time(&time);