diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-03 23:56:17 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-05 02:43:56 +0900 |
commit | 4bbccb02eaee35e20d3031e7ba4b3d08631ce934 (patch) | |
tree | 27fed6568b9faa5a2586c5929159b79a4002c294 /src/journal-remote/journal-gatewayd.c | |
parent | 7fa6223f67662e8d5ee26092240b4e1d091a69f5 (diff) | |
download | systemd-4bbccb02eaee35e20d3031e7ba4b3d08631ce934.tar.gz |
tree-wide: introduce strerror_safe()
Diffstat (limited to 'src/journal-remote/journal-gatewayd.c')
-rw-r--r-- | src/journal-remote/journal-gatewayd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 734e8c7f33..459d8e86a1 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -15,6 +15,7 @@ #include "alloc-util.h" #include "bus-util.h" +#include "errno-util.h" #include "fd-util.h" #include "fileio.h" #include "hostname-util.h" @@ -252,7 +253,7 @@ static ssize_t request_reader_entries( errno = 0; k = fread(buf, 1, n, m->tmp); if (k != n) { - log_error("Failed to read from file: %s", errno ? strerror(errno) : "Premature EOF"); + log_error("Failed to read from file: %s", errno != 0 ? strerror_safe(errno) : "Premature EOF"); return MHD_CONTENT_READER_END_WITH_ERROR; } @@ -605,7 +606,7 @@ static ssize_t request_reader_fields( errno = 0; k = fread(buf, 1, n, m->tmp); if (k != n) { - log_error("Failed to read from file: %s", errno ? strerror(errno) : "Premature EOF"); + log_error("Failed to read from file: %s", errno != 0 ? strerror_safe(errno) : "Premature EOF"); return MHD_CONTENT_READER_END_WITH_ERROR; } |