chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service/socket: show main/control pids in dump
[elogind.git]
/
target.c
diff --git
a/target.c
b/target.c
index b18e50fe5bdf756e49f8bee3fd657ff14f2f7fb5..c80c09d546b62a46bb97bcb3d65a99a850971443 100644
(file)
--- a/
target.c
+++ b/
target.c
@@
-20,6
+20,7
@@
***/
#include <errno.h>
***/
#include <errno.h>
+#include <signal.h>
#include "unit.h"
#include "target.h"
#include "unit.h"
#include "target.h"
@@
-36,18
+37,6
@@
static const char* const state_string_table[_TARGET_STATE_MAX] = {
[TARGET_ACTIVE] = "active"
};
[TARGET_ACTIVE] = "active"
};
-static int target_init(Unit *u) {
- int r;
- assert(u);
-
- /* Make sure this config file actually exists */
-
- if ((r = unit_load_fragment_and_dropin(u)) <= 0)
- return r < 0 ? r : -ENOENT;
-
- return 0;
-}
-
static void target_dump(Unit *u, FILE *f, const char *prefix) {
Target *t = TARGET(u);
static void target_dump(Unit *u, FILE *f, const char *prefix) {
Target *t = TARGET(u);
@@
-63,6
+52,9
@@
static void target_set_state(Target *t, TargetState state) {
TargetState old_state;
assert(t);
TargetState old_state;
assert(t);
+ if (state == t->state)
+ return;
+
old_state = t->state;
t->state = state;
old_state = t->state;
t->state = state;
@@
-100,7
+92,7
@@
static UnitActiveState target_active_state(Unit *u) {
const UnitVTable target_vtable = {
.suffix = ".target",
const UnitVTable target_vtable = {
.suffix = ".target",
- .init =
target_init
,
+ .init =
unit_load_fragment_and_dropin
,
.dump = target_dump,
.dump = target_dump,