From: Karel Zak Date: Fri, 30 Oct 2009 11:20:51 +0000 (+0100) Subject: libblkid: does not return useless binary data X-Git-Tag: v2.17-rc1~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7be1a742634d74c7434e3e99c5ff93ed5b1f435;p=thirdparty%2Futil-linux.git libblkid: does not return useless binary data Currently, the binary blkid_probe_get_{topology,partitions}() API returns empty structs when information has not been gathered. This is confusing for applications. It's seems better to return NULL. Reported-by: Hans de Goede Signed-off-by: Karel Zak --- diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c index 27bcf3d83a..f8610cb611 100644 --- a/shlibs/blkid/src/probe.c +++ b/shlibs/blkid/src/probe.c @@ -306,7 +306,7 @@ void *blkid_probe_get_binary_data(blkid_probe pr, struct blkid_chain *chn) chn->binary = FALSE; pr->cur_chain = NULL; - if (rc < 0) + if (rc != 0) return NULL; DBG(DEBUG_LOWPROBE,