summaryrefslogtreecommitdiff
path: root/src/switchroot
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2019-04-25 09:08:23 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2019-04-25 13:00:40 +0000
commit304abee9eba964d945eacad9217dcd4f9c678d4a (patch)
tree9b96cc8dcc4711f8772133a86d85969a0c05cd3d /src/switchroot
parent586cc2deee96ada367a6033f9062e8b0c24bc687 (diff)
downloadostree-304abee9eba964d945eacad9217dcd4f9c678d4a.tar.gz
prepare-root: Fix compilation with --with-static-compiler
Closes: https://github.com/ostreedev/ostree/issues/1845 Closes: #1846 Approved by: akiernan
Diffstat (limited to 'src/switchroot')
-rw-r--r--src/switchroot/ostree-prepare-root.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c
index c4208750..15d49963 100644
--- a/src/switchroot/ostree-prepare-root.c
+++ b/src/switchroot/ostree-prepare-root.c
@@ -47,7 +47,11 @@
#include <errno.h>
#include <ctype.h>
-#ifdef HAVE_LIBSYSTEMD
+#if defined(HAVE_LIBSYSTEMD) && !defined(OSTREE_PREPARE_ROOT_STATIC)
+#define USE_LIBSYSTEMD
+#endif
+
+#ifdef USE_LIBSYSTEMD
#include <systemd/sd-journal.h>
#define OSTREE_PREPARE_ROOT_DEPLOYMENT_MSG SD_ID128_MAKE(71,70,33,6a,73,ba,46,01,ba,d3,1a,f8,88,aa,0d,f7)
#endif
@@ -79,7 +83,7 @@ resolve_deploy_path (const char * root_mountpoint)
if (stat (deploy_path, &stbuf) < 0)
err (EXIT_FAILURE, "stat(%s) failed", deploy_path);
/* Quiet logs if there's no journal */
-#ifdef HAVE_LIBSYSTEMD
+#ifdef USE_LIBSYSTEMD
const char *resolved_path = deploy_path + strlen (root_mountpoint);
sd_journal_send ("MESSAGE=Resolved OSTree target to: %s", deploy_path,
"MESSAGE_ID=" SD_ID128_FORMAT_STR,