summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/cat.c3
-rw-r--r--src/journal/coredumpctl.c7
-rw-r--r--src/journal/journal-verify.c10
-rw-r--r--src/journal/journalctl.c6
4 files changed, 10 insertions, 16 deletions
diff --git a/src/journal/cat.c b/src/journal/cat.c
index 2e236f0004..be2c2e3354 100644
--- a/src/journal/cat.c
+++ b/src/journal/cat.c
@@ -142,8 +142,7 @@ int main(int argc, char *argv[]) {
if (dup3(fd, STDOUT_FILENO, 0) < 0 ||
dup3(fd, STDERR_FILENO, 0) < 0) {
- log_error_errno(errno, "Failed to duplicate fd: %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to duplicate fd: %m");
goto finish;
}
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 644ba91b0d..0fa427003b 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -631,8 +631,8 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
sz = write(fdt, data, len);
if (sz < 0) {
- log_error_errno(errno, "Failed to write temporary file: %m");
- r = -errno;
+ r = log_error_errno(errno,
+ "Failed to write temporary file: %m");
goto error;
}
if (sz != (ssize_t) len) {
@@ -758,8 +758,7 @@ static int run_gdb(sd_journal *j) {
pid = fork();
if (pid < 0) {
- log_error_errno(errno, "Failed to fork(): %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to fork(): %m");
goto finish;
}
if (pid == 0) {
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index eaf006db7a..00f70d3a53 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -839,22 +839,20 @@ int journal_file_verify(
data_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC);
if (data_fd < 0) {
- log_error_errno(errno, "Failed to create data file: %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to create data file: %m");
goto fail;
}
entry_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC);
if (entry_fd < 0) {
- log_error_errno(errno, "Failed to create entry file: %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to create entry file: %m");
goto fail;
}
entry_array_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC);
if (entry_array_fd < 0) {
- log_error_errno(errno, "Failed to create entry array file: %m");
- r = -errno;
+ r = log_error_errno(errno,
+ "Failed to create entry array file: %m");
goto fail;
}
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index ce2dd9da26..d31ab1c6d7 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1428,8 +1428,7 @@ static int setup_keys(void) {
fd = open("/dev/random", O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0) {
- log_error_errno(errno, "Failed to open /dev/random: %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to open /dev/random: %m");
goto finish;
}
@@ -1488,8 +1487,7 @@ static int setup_keys(void) {
}
if (link(k, p) < 0) {
- log_error_errno(errno, "Failed to link file: %m");
- r = -errno;
+ r = log_error_errno(errno, "Failed to link file: %m");
goto finish;
}