chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: parse configuration file
[elogind.git]
/
src
/
unit.c
diff --git
a/src/unit.c
b/src/unit.c
index 057431c8087a7d17b85fd8cb49374a1a6598a966..87b7edf145824ee735448f6f4d44aa4fe9d6741c 100644
(file)
--- a/
src/unit.c
+++ b/
src/unit.c
@@
-2305,21
+2305,25
@@
void unit_status_printf(Unit *u, const char *format, ...) {
}
bool unit_need_daemon_reload(Unit *u) {
}
bool unit_need_daemon_reload(Unit *u) {
- struct stat st;
-
assert(u);
assert(u);
- if (
!u->meta.fragment_path)
-
return false
;
+ if (
u->meta.fragment_path) {
+
struct stat st
;
- zero(st);
- if (stat(u->meta.fragment_path, &st) < 0)
- /* What, cannot access this anymore? */
- return true;
+
zero(st);
+
if (stat(u->meta.fragment_path, &st) < 0)
+
/* What, cannot access this anymore? */
+
return true;
- return
- u->meta.fragment_mtime &&
- timespec_load(&st.st_mtim) != u->meta.fragment_mtime;
+ if (u->meta.fragment_mtime > 0 &&
+ timespec_load(&st.st_mtim) != u->meta.fragment_mtime)
+ return true;
+ }
+
+ if (UNIT_VTABLE(u)->need_daemon_reload)
+ return UNIT_VTABLE(u)->need_daemon_reload(u);
+
+ return false;
}
void unit_reset_failed(Unit *u) {
}
void unit_reset_failed(Unit *u) {