summaryrefslogtreecommitdiff
path: root/src/coredump/coredumpctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-03-01 22:14:33 +0100
committerGitHub <noreply@github.com>2017-03-01 22:14:33 +0100
commit47ef78b27f2035b267c4600b4eac1eb298e9e7a4 (patch)
tree02fbac7dfc3201d7d879157bdd985c4a5aed19cc /src/coredump/coredumpctl.c
parent23eb30b33ec4c196d618c76747475063d3f088ad (diff)
parent501551e80315b1e50391dbc958bc2c8dcda7cf98 (diff)
Merge pull request #5502 from poettering/coredump-mini-fixes
Coredump mini improvments
Diffstat (limited to 'src/coredump/coredumpctl.c')
-rw-r--r--src/coredump/coredumpctl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
index 3e9a00bbcf..114a13fc78 100644
--- a/src/coredump/coredumpctl.c
+++ b/src/coredump/coredumpctl.c
@@ -51,6 +51,8 @@
#include "user-util.h"
#include "util.h"
+#define SHORT_BUS_CALL_TIMEOUT_USEC (3 * USEC_PER_SEC)
+
static usec_t arg_since = USEC_INFINITY, arg_until = USEC_INFINITY;
static enum {
@@ -414,7 +416,7 @@ static int print_list(FILE* file, sd_journal *j, int had_legend) {
else
present = "-";
- if (STR_IN_SET(present, "present", "journal") && streq_ptr(truncated, "yes"))
+ if (STR_IN_SET(present, "present", "journal") && truncated && parse_boolean(truncated) > 0)
present = "truncated";
fprintf(file, "%-*s %*s %*s %*s %*s %-*s %s\n",
@@ -583,8 +585,10 @@ static int print_info(FILE *file, sd_journal *j, bool need_space) {
fprintf(file, " Hostname: %s\n", hostname);
if (filename) {
- bool inacc = access(filename, R_OK) < 0;
- bool trunc = streq_ptr(truncated, "yes");
+ bool inacc, trunc;
+
+ inacc = access(filename, R_OK) < 0;
+ trunc = truncated && parse_boolean(truncated) > 0;
if (inacc || trunc)
fprintf(file, " Storage: %s%s (%s%s%s)%s\n",
@@ -990,7 +994,7 @@ static int check_units_active(void) {
if (r < 0)
return bus_log_create_error(r);
- r = sd_bus_call(bus, m, 3 * USEC_PER_SEC, &error, &reply);
+ r = sd_bus_call(bus, m, SHORT_BUS_CALL_TIMEOUT_USEC, &error, &reply);
if (r < 0)
return log_error_errno(r, "Failed to check if any systemd-coredump@.service units are running: %s",
bus_error_message(&error, r));