From 825311052b84d0673ed5118fdce728df21f8dd26 Mon Sep 17 00:00:00 2001 From: hyunuktak Date: Thu, 23 Jun 2016 14:25:03 +0900 Subject: [PATCH] Added some log for save/load keyfile Change-Id: I7c03dc9e311754be3a243ce0e9d4db639c7718b6 Signed-off-by: hyunuktak --- packaging/net-config.spec | 2 +- src/utils/util.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index a5e0037..d491379 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.77 +Version: 1.1.78 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/utils/util.c b/src/utils/util.c index 336e6be..482b53c 100755 --- a/src/utils/util.c +++ b/src/utils/util.c @@ -62,6 +62,7 @@ GKeyFile *netconfig_keyfile_load(const char *pathname) keyfile = NULL; } + DBG("loaded keyfile %s", pathname); return keyfile; } @@ -80,6 +81,7 @@ void netconfig_keyfile_save(GKeyFile *keyfile, const char *pathname) if (directory == NULL || (*directory) == '\0') { g_free(directory); + ERR("directory is NULL"); return; } @@ -87,6 +89,7 @@ void netconfig_keyfile_save(GKeyFile *keyfile, const char *pathname) if (g_mkdir_with_parents(directory, S_IRUSR | S_IWUSR | S_IXUSR) != 0) { g_free(directory); + ERR("failed to make directory"); return; } } @@ -94,11 +97,12 @@ void netconfig_keyfile_save(GKeyFile *keyfile, const char *pathname) keydata = g_key_file_to_data(keyfile, &size, &error); if (g_file_set_contents(pathname, keydata, size, &error) != TRUE) { - DBG("Unable to save %s, error %s", pathname, error->message); + ERR("Unable to save %s, error %s", pathname, error->message); g_error_free(error); } chmod(pathname, S_IRUSR | S_IWUSR); + DBG("Successfully saved keyfile %s", pathname); g_free(keydata); } -- 2.34.1