return 0;
if (exclude_fd >= 0) {
- if (fstat(exclude_fd, &exclude_st) < 0) {
- log_error("Failed to fstat(): %m");
- return -errno;
- }
+ if (fstat(exclude_fd, &exclude_st) < 0)
+ return log_error_errno(errno, "Failed to fstat(): %m");
}
/* This algorithm will keep deleting the oldest file of the
if (errno == ENOENT)
return 0;
- log_error("Can't open coredump directory: %m");
+ log_error_errno(errno, "Can't open coredump directory: %m");
return -errno;
}
if (errno == ENOENT)
continue;
- log_error("Failed to remove file %s: %m", worst->oldest_file);
+ log_error_errno(errno, "Failed to remove file %s: %m", worst->oldest_file);
return -errno;
} else
log_info("Removed old coredump %s.", worst->oldest_file);
return 0;
fail:
- log_error("Failed to read directory: %m");
+ log_error_errno(errno, "Failed to read directory: %m");
return -errno;
}