anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

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

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