free(u->description);
strv_free(u->documentation);
free(u->fragment_path);
+ free(u->source_path);
free(u->instance);
set_free_free(u->names);
if (u->fragment_path)
fprintf(f, "%s\tFragment Path: %s\n", prefix, u->fragment_path);
+ if (u->source_path)
+ fprintf(f, "%s\tSource Path: %s\n", prefix, u->source_path);
+
if (u->job_timeout > 0)
fprintf(f, "%s\tJob Timeout: %s\n", prefix, format_timespan(timespan, sizeof(timespan), u->job_timeout));
}
bool unit_need_daemon_reload(Unit *u) {
+ struct stat st;
+
assert(u);
if (u->fragment_path) {
- struct stat st;
-
zero(st);
if (stat(u->fragment_path, &st) < 0)
/* What, cannot access this anymore? */
return true;
}
- if (UNIT_VTABLE(u)->need_daemon_reload)
- return UNIT_VTABLE(u)->need_daemon_reload(u);
+ if (u->source_path) {
+ zero(st);
+ if (stat(u->source_path, &st) < 0)
+ return true;
+
+ if (u->source_mtime > 0 &&
+ timespec_load(&st.st_mtim) != u->source_mtime)
+ return true;
+ }
return false;
}