Displaying 2 results from an estimated 2 matches for "do_blkid".
2011 Dec 05
1
[PATCH] blkid: split the RHEL5 which can't support some options
...+++++-----
1 files changed, 73 insertions(+), 7 deletions(-)
diff --git a/daemon/blkid.c b/daemon/blkid.c
index a7fd6bc..8c2cdc6 100644
--- a/daemon/blkid.c
+++ b/daemon/blkid.c
@@ -84,18 +84,42 @@ do_vfs_uuid (const char *device)
return get_blkid_tag (device, "UUID");
}
-char **
-do_blkid(const char *device)
+/* RHEL5 blkid doesn't have the -p(partition info) option and the
+ * -i(I/O limits) option so we must test for these options the first
+ * time the function is called.
+ */
+static int
+test_blkid_p_opt(void)
+{
+ static int result = -1;
+ char *err = NULL;
+
+ int r =...
2011 Dec 03
1
[PATCH] NEW API: add blkid command to print the attributes of the device
...2 +-
3 files changed, 149 insertions(+), 1 deletions(-)
diff --git a/daemon/blkid.c b/daemon/blkid.c
index 6d395c1..a7fd6bc 100644
--- a/daemon/blkid.c
+++ b/daemon/blkid.c
@@ -83,3 +83,78 @@ do_vfs_uuid (const char *device)
{
return get_blkid_tag (device, "UUID");
}
+
+char **
+do_blkid(const char *device)
+{
+ int r;
+ char *out = NULL, *err = NULL;
+ char **lines = NULL;
+
+ char **ret = NULL;
+ int size = 0, alloc = 0;
+
+ const char *blkid[] = {"blkid", "-p", "-i", "-o", "export", device, NULL};
+ r = commandv(&out,...