SHA256
1
0
forked from pool/systemd
systemd/0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch

38 lines
1.4 KiB
Diff
Raw Normal View History

Based on b4af5a803aa71a57733ca46fef29b7afb20a626c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 7 Jul 2014 17:33:26 +0200
Subject: [PATCH] systemctl: show StatusErrno value in "systemctl status"
---
src/systemctl/systemctl.c | 5 +++++
1 file changed, 5 insertions(+)
--- src/systemctl/systemctl.c
+++ src/systemctl/systemctl.c 2014-07-08 10:57:30.170735691 +0000
@@ -2710,6 +2710,7 @@ typedef struct UnitStatusInfo {
const char *status_text;
const char *pid_file;
bool running:1;
+ int status_errno;
usec_t start_timestamp;
usec_t exit_timestamp;
@@ -2982,6 +2983,8 @@ static void print_status_info(
if (i->status_text)
printf(" Status: \"%s\"\n", i->status_text);
+ if (i->status_errno > 0)
+ printf(" Error: %i (%s)\n", i->status_errno, strerror(i->status_errno));
if (i->control_group &&
(i->main_pid > 0 || i->control_pid > 0 || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0)) {
@@ -3203,6 +3206,8 @@ static int status_property(const char *n
i->exit_code = (int) j;
else if (streq(name, "ExecMainStatus"))
i->exit_status = (int) j;
+ else if (streq(name, "StatusErrno"))
+ i->status_errno = (int) j;
break;
}