aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-08-26 13:00:41 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-08-26 15:28:59 +0300
commit3f3551826bfc9bb662db11e22b9774e1ca2d3c63 (patch)
treea68536e0b9caed70835a3360045c9fb4b4b563f1
parenta0a1100aa899e860748b29d563d4d2c72cff9f92 (diff)
downloadpacrunner-3f3551826bfc9bb662db11e22b9774e1ca2d3c63.tar.gz
main: Use gboolean type in GOptionEntry
The GOptionEntry options need to be of gboolean type as they are passed as pointers. When the size of gboolean is different from the size of bool, it will cause option variables to be overwritten by each other.
-rw-r--r--src/log.c2
-rw-r--r--src/main.c4
-rw-r--r--src/pacrunner.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/log.c b/src/log.c
index 74ad7e4..5f36ed3 100644
--- a/src/log.c
+++ b/src/log.c
@@ -96,7 +96,7 @@ static bool is_enabled(struct pacrunner_debug_desc *desc)
return false;
}
-int __pacrunner_log_init(const char *debug, bool detach)
+int __pacrunner_log_init(const char *debug, gboolean detach)
{
int option = LOG_NDELAY | LOG_PID;
struct pacrunner_debug_desc *desc;
diff --git a/src/main.c b/src/main.c
index aa3f876..f3767e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -116,8 +116,8 @@ static void disconnect_callback(DBusConnection *conn, void *user_data)
static gchar *option_debug = NULL;
static gchar *option_plugin = NULL;
static gchar *option_noplugin = NULL;
-static bool option_detach = true;
-static bool option_version = false;
+static gboolean option_detach = TRUE;
+static gboolean option_version = FALSE;
static bool parse_debug(const char *key, const char *value,
gpointer user_data, GError **error)
diff --git a/src/pacrunner.h b/src/pacrunner.h
index 6d08b65..6731d7c 100644
--- a/src/pacrunner.h
+++ b/src/pacrunner.h
@@ -38,7 +38,7 @@
#include "log.h"
-int __pacrunner_log_init(const char *debug, bool detach);
+int __pacrunner_log_init(const char *debug, gboolean detach);
void __pacrunner_log_cleanup(void);
#include "plugin.h"