[systemd-commits] src/journal

Daniel Mack zonque at kemper.freedesktop.org
Thu Jun 26 01:33:19 PDT 2014


 src/journal/coredumpctl.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 2fb8159fb3f7701fa0f658fb3c3a7732cc7f40fe
Author: Daniel Mack <zonque at gmail.com>
Date:   Thu Jun 26 10:31:23 2014 +0200

    coredumpctl: fix build with !HAVE_XZ
    
    Fixes the following build error:
    
      CCLD     coredumpctl
    src/journal/coredumpctl.o: In function `save_core':
    /src/systemd-master/src/journal/coredumpctl.c:656:
    undefined reference to `decompress_stream'
    collect2: error: ld returned 1 exit status
    make[2]: *** [coredumpctl] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 08d8cdf..ba78539 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -644,6 +644,7 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
                                 goto error;
                         }
                 } else if (filename) {
+#if HAVE_XZ
                         _cleanup_close_ int fdf;
 
                         fdf = open(filename, O_RDONLY | O_CLOEXEC);
@@ -658,6 +659,11 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
                                 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.");



More information about the systemd-commits mailing list