summaryrefslogtreecommitdiffstats
path: root/libblkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2013-06-13 14:33:47 +0200
committerKarel Zak2013-06-13 14:33:47 +0200
commit9c06cdbf61465509df37c6c58694ce8ea07ed943 (patch)
treed9c3aaa332d4b7edbded55688761a231516360f5 /libblkid/src/probe.c
parentmkfs.bfs: fix 64-Bit and endian problems (diff)
downloadkernel-qcow2-util-linux-9c06cdbf61465509df37c6c58694ce8ea07ed943.tar.gz
kernel-qcow2-util-linux-9c06cdbf61465509df37c6c58694ce8ea07ed943.tar.xz
kernel-qcow2-util-linux-9c06cdbf61465509df37c6c58694ce8ea07ed943.zip
libblkid: make uuid_is_empty() usable for whole library
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r--libblkid/src/probe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 954b08708..d2b301d7f 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -1637,6 +1637,16 @@ void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len)
}
#endif
+/* like uuid_is_null() from libuuid, but works with arbitrary size of UUID */
+int blkid_uuid_is_empty(const unsigned char *buf, size_t len)
+{
+ size_t i;
+
+ for (i = 0; i < len; i++)
+ if (buf[i])
+ return 0;
+ return 1;
+}
/* Removes whitespace from the right-hand side of a string (trailing
* whitespace).