]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libshared: fix compilation without libblkid
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Apr 2017 23:05:05 +0000 (19:05 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Apr 2017 16:05:55 +0000 (12:05 -0400)
This reverts a75e27eba75e27eb fixed the case of libcryptsetup=no, libblkid=yes,
but broke the case of libcryptsetup=no, libblkid=yes. Instead of trying to define
the function only when used, which would result in too much ifdeffery, just silence
the warning.

src/shared/dissect-image.c

index 36c94ac71b4872ea438471117fce8570ff43f122..163995c1e5f5a760c20d92e2a0d023fa9335c01d 100644 (file)
@@ -42,8 +42,8 @@
 #include "udev-util.h"
 #include "xattr-util.h"
 
+_unused_ static int probe_filesystem(const char *node, char **ret_fstype) {
 #ifdef HAVE_BLKID
-static int probe_filesystem(const char *node, char **ret_fstype) {
         _cleanup_blkid_free_probe_ blkid_probe b = NULL;
         const char *fstype;
         int r;
@@ -80,8 +80,10 @@ static int probe_filesystem(const char *node, char **ret_fstype) {
 not_found:
         *ret_fstype = NULL;
         return 0;
-}
+#else
+        return -EOPNOTSUPP;
 #endif
+}
 
 int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) {
 
@@ -949,7 +951,7 @@ int dissected_image_decrypt(
          *
          *      = 0           → There was nothing to decrypt
          *      > 0           → Decrypted successfully
-         *      -ENOKEY       → There's some to decrypt but no key was supplied
+         *      -ENOKEY       → There's something to decrypt but no key was supplied
          *      -EKEYREJECTED → Passed key was not correct
          */