summaryrefslogtreecommitdiff
path: root/src/login/logind-core.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-24 18:13:12 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commite3ef5e1e1e4269e9f9f02f73778db58a83a626fb (patch)
tree2080dd85ab3343f7f1a4e6a1898e41dcd62c4614 /src/login/logind-core.c
parentcbb9e59083da8cedd08a059008f8ef2b1bac25a2 (diff)
logind: modernize Manager object allocation and freeing
Let's propagate errors correctly, and stick to the usual naming and behaviour of these functions. Or in other words, make this closer to the matching code in machined.
Diffstat (limited to 'src/login/logind-core.c')
-rw-r--r--src/login/logind-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index 581f4078a..3775c300b 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -26,6 +26,8 @@
#include "user-util.h"
void manager_reset_config(Manager *m) {
+ assert(m);
+
m->n_autovts = 6;
m->reserve_vt = 6;
m->remove_ipc = true;
@@ -573,7 +575,7 @@ static bool manager_is_docked(Manager *m) {
}
static int manager_count_external_displays(Manager *m) {
- _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL;
+ _cleanup_(udev_enumerate_unrefp) struct udev_enumerate *e = NULL;
struct udev_list_entry *item = NULL, *first = NULL;
int r;
int n = 0;
@@ -592,7 +594,7 @@ static int manager_count_external_displays(Manager *m) {
first = udev_enumerate_get_list_entry(e);
udev_list_entry_foreach(item, first) {
- _cleanup_udev_device_unref_ struct udev_device *d = NULL;
+ _cleanup_(udev_device_unrefp) struct udev_device *d = NULL;
struct udev_device *p;
const char *status, *enabled, *dash, *nn, *i;
bool external = false;