summaryrefslogtreecommitdiffstats
path: root/src/core/path.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-08-04 21:14:27 +0200
committerLennart Poettering <lennart@poettering.net>2016-08-04 23:08:05 +0200
commita0fef983ab200db4e2b151beb06c9cf8fef6c5ab (patch)
treef9043614053b8df8735f1d6494c291605e0f5d21 /src/core/path.c
parentupdate TODO (diff)
downloadsystemd-a0fef983ab200db4e2b151beb06c9cf8fef6c5ab.tar.xz
systemd-a0fef983ab200db4e2b151beb06c9cf8fef6c5ab.zip
core: remember first unit failure, not last unit failure
Previously, the result value of a unit was overriden with each failure that took place, so that the result always reported the last failure that took place. With this commit this is changed, so that the first failure taking place is stored instead. This should normally not matter much as multiple failures are sufficiently uncommon. However, it improves one behaviour: if we send SIGABRT to a service due to a watchdog timeout, then this currently would be reported as "coredump" failure, rather than the "watchodg" failure it really is. Hence, in order to report information about the type of the failure, and not about the effect of it, let's change this from all unit type to store the first, not the last failure. This addresses the issue pointed out here: https://github.com/systemd/systemd/pull/3818#discussion_r73433520
Diffstat (limited to 'src/core/path.c')
-rw-r--r--src/core/path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/path.c b/src/core/path.c
index 0dd0d375d8..10f9b06974 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -454,7 +454,7 @@ static int path_coldplug(Unit *u) {
static void path_enter_dead(Path *p, PathResult f) {
assert(p);
- if (f != PATH_SUCCESS)
+ if (p->result == PATH_SUCCESS)
p->result = f;
path_set_state(p, p->result != PATH_SUCCESS ? PATH_FAILED : PATH_DEAD);