summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-20 14:25:32 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-20 15:57:56 +0100
commit168fd4ad5d1e5da93e11388095d41aaa8f804ceb (patch)
treebaca1b79ff1412dfcc7b32502b4566927b3bdad0 /src
parent764e4e2aa289b645b64feff454d376a86486d219 (diff)
downloadlibguestfs-168fd4ad5d1e5da93e11388095d41aaa8f804ceb.tar.gz
libguestfs-168fd4ad5d1e5da93e11388095d41aaa8f804ceb.tar.xz
libguestfs-168fd4ad5d1e5da93e11388095d41aaa8f804ceb.zip
blkid: Detect when value not found and return empty string.
If the blkid command returns 2, that means the value was not found. Note that this changes the output of the vfs-type API when the filesystem has no type (eg when it is empty). Previously this would return an error. Now it returns empty string "". We did not document this either way. Making it return empty string is consistent with vfs-label and vfs-uuid. This change broke list-filesystems, since that code was assuming that vfs-type could only return a filesystem type or an error.
Diffstat (limited to 'src')
-rw-r--r--src/listfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/listfs.c b/src/listfs.c
index a89cd9bd..42bbaef0 100644
--- a/src/listfs.c
+++ b/src/listfs.c
@@ -139,6 +139,10 @@ check_with_vfs_type (guestfs_h *g, const char *device,
if (!vfs_type)
v = safe_strdup (g, "unknown");
+ else if (STREQ (vfs_type, "")) {
+ free (vfs_type);
+ v = safe_strdup (g, "unknown");
+ }
else {
/* Ignore all "*_member" strings. In libblkid these are returned
* for things which are members of some RAID or LVM set, most