valeriyvdovin / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0256-service-flush-status-text-and-errno-values-each-time.patch

65878a
From 5078832417b89cfe92ad87133ecb4179a995db31 Mon Sep 17 00:00:00 2001
65878a
From: Lennart Poettering <lennart@poettering.net>
65878a
Date: Mon, 7 Jul 2014 17:33:46 +0200
65878a
Subject: [PATCH] service: flush status text and errno values each time a
65878a
 service is started
65878a
65878a
We shouldn't show status texts from previous service starts
65878a
65878a
(cherry picked from commit 8cfdb077b8e3da1c47fc1d735d051f21f33144c1)
65878a
65878a
Related: #1106457
65878a
---
65878a
 src/core/service.c | 4 ++++
65878a
 1 file changed, 4 insertions(+)
65878a
65878a
diff --git a/src/core/service.c b/src/core/service.c
65878a
index 814019d..a6d046c 100644
65878a
--- a/src/core/service.c
65878a
+++ b/src/core/service.c
65878a
@@ -2579,6 +2579,10 @@ static int service_start(Unit *u) {
65878a
         s->main_pid_alien = false;
65878a
         s->forbid_restart = false;
65878a
 
65878a
+        free(s->status_text);
65878a
+        s->status_text = NULL;
65878a
+        s->status_errno = 0;
65878a
+
65878a
         service_enter_start_pre(s);
65878a
         return 0;
65878a
 }