summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaLyong Cho <walyong.cho@samsung.com>2016-11-08 07:28:17 (GMT)
committerWaLyong Cho <walyong.cho@samsung.com>2016-11-08 07:31:07 (GMT)
commitafe1bda81ad5fb9bdbcc224f090e6b4b17dae563 (patch)
treed61d69f9fe8d9a9453ad65bfa17ad884becfd65d
parent6ca33f19ad13621de873331cda113b729a31fe7c (diff)
downloadlibsystem-afe1bda81ad5fb9bdbcc224f090e6b4b17dae563.zip
libsystem-afe1bda81ad5fb9bdbcc224f090e6b4b17dae563.tar.gz
libsystem-afe1bda81ad5fb9bdbcc224f090e6b4b17dae563.tar.bz2
libsystem-sd: use g_auto(), g_autoptr() or g_autofree
To use g_auto(), g_autoptr() and g_autofree, add version dependency glib >= 2.44. Change-Id: I13c8fccb89078bd1c49b9e9e37f8945dd1226578 Signed-off-by: WaLyong Cho <walyong.cho@samsung.com>
-rw-r--r--packaging/libsystem.spec4
-rw-r--r--src/libsystem-sd/systemd.c34
2 files changed, 19 insertions, 19 deletions
diff --git a/packaging/libsystem.spec b/packaging/libsystem.spec
index c4308f9..d52cbc5 100644
--- a/packaging/libsystem.spec
+++ b/packaging/libsystem.spec
@@ -11,8 +11,8 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig(dbus-1)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(glib-2.0) >= 2.44
+BuildRequires: pkgconfig(gio-2.0) >= 2.44
Requires: /bin/cp
diff --git a/src/libsystem-sd/systemd.c b/src/libsystem-sd/systemd.c
index ec53b90..cfcd5d6 100644
--- a/src/libsystem-sd/systemd.c
+++ b/src/libsystem-sd/systemd.c
@@ -87,7 +87,7 @@ static int systemd_call_sync(GDBusConnection *connection,
NULL,
&err);
else {
- _cleanup_g_object_unref_ GDBusProxy *proxy = NULL;
+ g_autofree GDBusProxy *proxy = NULL;
proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -125,8 +125,8 @@ static int systemd_call_sync(GDBusConnection *connection,
}
int systemd_subscribe(GDBusConnection *connection, char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
int r;
r = systemd_call_sync(connection,
@@ -148,8 +148,8 @@ int systemd_subscribe(GDBusConnection *connection, char **err_msg) {
}
int systemd_unsubscribe(GDBusConnection *connection, char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
int r;
r = systemd_call_sync(connection,
@@ -175,8 +175,8 @@ int systemd_get_unit(GDBusConnection *connection,
char **unit,
char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
char *obj = NULL;
int r;
@@ -219,8 +219,8 @@ int systemd_control_unit(GDBusConnection *connection,
char **job,
char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
char *obj = NULL;
int r;
@@ -347,7 +347,7 @@ static int systemd_get_property(GDBusConnection *connection,
GVariant **variant,
char **err_msg) {
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GError *error = NULL;
int r;
assert(name);
@@ -471,7 +471,7 @@ static int systemd_get_service_property(GDBusConnection *connection,
value* result, \
char** err_msg) { \
\
- _cleanup_g_variant_unref_ GVariant *var = NULL, *inner = NULL; \
+ g_autofree GVariant *var = NULL, *inner = NULL; \
int r; \
\
assert(target); \
@@ -606,7 +606,7 @@ void systemd_unit_status_list_free_full(GList *status_list) {
static int systemd_parse_list_units_result(GVariant *result, GList **unit_list) {
char *name, *description, *load_state, *active_state, *sub_state;
char *followed, *obj_path, *job_type, *job_obj_path;
- _cleanup_g_variant_iter_free_ GVariantIter *iter;
+ g_autofree GVariantIter *iter;
unsigned int job_id;
GList *list = NULL;
int r;
@@ -728,8 +728,8 @@ on_error:
}
int systemd_get_units_list(GDBusConnection *conn, GList **unit_list, char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
int r;
assert(unit_list);
@@ -786,7 +786,7 @@ void systemd_unit_file_status_list_free_full(GList *status_list) {
}
static int systemd_parse_list_unit_files_result(GVariant *result, GList **unit_files_list) {
- _cleanup_g_variant_iter_free_ GVariantIter *iter;
+ g_autofree GVariantIter *iter;
GList *list = NULL;
char *name, *status;
int r;
@@ -843,8 +843,8 @@ on_error:
}
int systemd_get_unit_files_list(GDBusConnection *conn, GList **unit_files_list, char **err_msg) {
- _cleanup_g_variant_unref_ GVariant *reply = NULL;
- _cleanup_g_error_free_ GError *error = NULL;
+ g_autofree GVariant *reply = NULL;
+ g_autofree GError *error = NULL;
int r;
assert(conn);