From 31cda3d1759dee3e48c8ed4a949d99f041bdca1c Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sun, 6 Jul 2014 18:35:46 -0400 Subject: coredumpctl: show a useful error on permission problems --- src/journal/coredumpctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c index 5d6b2c7adf..d1450c09a2 100644 --- a/src/journal/coredumpctl.c +++ b/src/journal/coredumpctl.c @@ -595,7 +595,8 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) { retrieve(data, len, "COREDUMP_FILENAME", &filename); if (filename && access(filename, R_OK) < 0) { - log_debug("File %s is not readable: %m", filename); + log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, + "File %s is not readable: %m", filename); free(filename); filename = NULL; } @@ -668,7 +669,7 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) { #endif } else { if (r == -ENOENT) - log_error("Coredump neither in journal file nor stored externally on disk."); + log_error("Cannot retrieve coredump from journal nor disk."); else log_error("Failed to retrieve COREDUMP field: %s", strerror(-r)); goto error; -- cgit v1.2.3-54-g00ecf