util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Henriksson <andreas@fatal.se>
To: util-linux@vger.kernel.org
Cc: Andreas Henriksson <andreas@fatal.se>
Subject: [PATCH 1/5] libmount: only invoke loopcxt on linux
Date: Fri, 19 Sep 2014 01:36:33 +0200	[thread overview]
Message-ID: <1411083397-8056-1-git-send-email-andreas@fatal.se> (raw)

This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 libmount/src/cache.c | 2 ++
 libmount/src/tab.c   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index 8b2e656..fcd84fd 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -633,6 +633,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
 	if (!pretty)
 		return strdup("none");
 
+#ifdef __linux__
 	/* users assume backing file name rather than /dev/loopN in
 	 * output if the device has been initialized by mount(8).
 	 */
@@ -653,6 +654,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
 		loopcxt_deinit(&lc);
 
 	}
+#endif
 
 done:
 	/* don't return pointer to the cache, allocate a new string */
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 4094fb8..011ba54 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -1439,8 +1439,10 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
 			} else
 				flags = LOOPDEV_FL_OFFSET;
 
+#if __linux__
 			if (loopdev_is_used(mnt_fs_get_srcpath(fs), src, offset, flags))
 				break;
+#endif
 		}
 
 		if (root) {
-- 
2.1.0.rc1


             reply	other threads:[~2014-09-19  0:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 23:36 Andreas Henriksson [this message]
2014-09-18 23:36 ` [PATCH 2/5] libmount: only include context on linux Andreas Henriksson
2014-09-18 23:36 ` [PATCH 3/5] build-sys: build libmount everywhere Andreas Henriksson
2014-09-18 23:36 ` [PATCH 4/5] build-sys: swaplabel needs libmount Andreas Henriksson
2014-09-22 11:27   ` Karel Zak
2014-09-18 23:36 ` [PATCH 5/5] logger: gettimeofday needs <sys/time.h> Andreas Henriksson
2014-09-22 11:21 ` [PATCH 1/5] libmount: only invoke loopcxt on linux Karel Zak
  -- strict thread matches above, loose matches on Subject: below --
2014-09-19  0:27 [PATCH] build-sys: link swapoff to libblkid Andreas Henriksson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411083397-8056-1-git-send-email-andreas@fatal.se \
    --to=andreas@fatal.se \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).