diff options
author | Shawn Landden <shawnlandden@gmail.com> | 2012-07-25 14:55:59 -0700 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-07-26 11:48:26 +0200 |
commit | 0d0f0c50d3a1d90f03972a6abb82e6413daaa583 (patch) | |
tree | 74f41c8455dbd78599f49300315a2569a8989992 /src/locale | |
parent | e146e4516b9ea9907852e7ad609de39dca9e8769 (diff) |
log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/localed.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c index b8007d72fd..22950a60a9 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -425,7 +425,7 @@ static void push_data(DBusConnection *bus) { l_set = new0(char*, _PROP_MAX); l_unset = new0(char*, _PROP_MAX); if (!l_set || !l_unset) { - log_error("Out of memory."); + log_oom(); goto finish; } @@ -438,7 +438,7 @@ static void push_data(DBusConnection *bus) { char *s; if (asprintf(&s, "%s=%s", names[p], data[p]) < 0) { - log_error("Out of memory."); + log_oom(); goto finish; } @@ -456,30 +456,30 @@ static void push_data(DBusConnection *bus) { dbus_message_iter_init_append(m, &iter); if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &sub)) { - log_error("Out of memory."); + log_oom(); goto finish; } STRV_FOREACH(t, l_unset) if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, t)) { - log_error("Out of memory."); + log_oom(); goto finish; } if (!dbus_message_iter_close_container(&iter, &sub) || !dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &sub)) { - log_error("Out of memory."); + log_oom(); goto finish; } STRV_FOREACH(t, l_set) if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, t)) { - log_error("Out of memory."); + log_oom(); goto finish; } if (!dbus_message_iter_close_container(&iter, &sub)) { - log_error("Out of memory."); + log_oom(); goto finish; } @@ -1344,8 +1344,7 @@ static int connect_bus(DBusConnection **_bus) { if (!dbus_connection_register_object_path(bus, "/org/freedesktop/locale1", &locale_vtable, NULL) || !dbus_connection_add_filter(bus, bus_exit_idle_filter, &remain_until, NULL)) { - log_error("Out of memory."); - r = -ENOMEM; + r = log_oom(); goto fail; } |