chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build-sys: add check for gperf lookup function signature (#5055)
[elogind.git]
/
src
/
login
/
logind-inhibit.c
diff --git
a/src/login/logind-inhibit.c
b/src/login/logind-inhibit.c
index 33fbdde557c92ae5d4f6a10b0eae0846c7454c3b..5ca42b1ca2ae2c4d14cc4f73f23e25d181b3112e 100644
(file)
--- a/
src/login/logind-inhibit.c
+++ b/
src/login/logind-inhibit.c
@@
-1,5
+1,3
@@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-28,7
+26,7
@@
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
-#include "format
s
-util.h"
+#include "format-util.h"
#include "logind-inhibit.h"
#include "mkdir.h"
#include "parse-util.h"
#include "logind-inhibit.h"
#include "mkdir.h"
#include "parse-util.h"
@@
-47,17
+45,14
@@
Inhibitor* inhibitor_new(Manager *m, const char* id) {
return NULL;
i->state_file = strappend("/run/systemd/inhibit/", id);
return NULL;
i->state_file = strappend("/run/systemd/inhibit/", id);
- if (!i->state_file) {
- free(i);
- return NULL;
- }
+ if (!i->state_file)
+ return mfree(i);
i->id = basename(i->state_file);
if (hashmap_put(m->inhibitors, i->id, i) < 0) {
free(i->state_file);
i->id = basename(i->state_file);
if (hashmap_put(m->inhibitors, i->id, i) < 0) {
free(i->state_file);
- free(i);
- return NULL;
+ return mfree(i);
}
i->manager = m;
}
i->manager = m;
@@
-299,7
+294,7
@@
int inhibitor_create_fifo(Inhibitor *i) {
if (r < 0)
return r;
if (r < 0)
return r;
- i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref"
, NULL
);
+ i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref");
if (!i->fifo_path)
return -ENOMEM;
if (!i->fifo_path)
return -ENOMEM;
@@
-319,7
+314,7
@@
int inhibitor_create_fifo(Inhibitor *i) {
if (r < 0)
return r;
if (r < 0)
return r;
- r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE);
+ r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE
-10
);
if (r < 0)
return r;
}
if (r < 0)
return r;
}