}
if (filename && !endswith(filename, ".xz")) {
- *path = filename;
- filename = NULL;
+ if (path) {
+ *path = filename;
+ filename = NULL;
+ }
return 0;
} else {
goto error;
}
} else if (filename) {
+#ifdef HAVE_XZ
_cleanup_close_ int fdf;
fdf = open(filename, O_RDONLY | O_CLOEXEC);
log_error("Failed to decompress %s: %s", filename, strerror(-r));
goto error;
}
+#else
+ log_error("Cannot decompress file. Compiled without XZ support.");
+ r = -ENOTSUP;
+ goto error;
+#endif
} else {
if (r == -ENOENT)
log_error("Coredump neither in journal file nor stored externally on disk.");
}
static int run_gdb(sd_journal *j) {
-
- _cleanup_free_ char *exe = NULL, *coredump = NULL, *path = NULL;
+ _cleanup_free_ char *exe = NULL, *path = NULL;
bool unlink_path = false;
const char *data;
siginfo_t st;