]> err.no Git - util-linux/commitdiff
libblkid: does not return useless binary data
authorKarel Zak <kzak@redhat.com>
Fri, 30 Oct 2009 11:20:51 +0000 (12:20 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 30 Oct 2009 11:20:51 +0000 (12:20 +0100)
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 <hdegoede@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/probe.c

index 27bcf3d83a6eccb5f0636ed23809eff46128a7d4..f8610cb61131878bd41eed16708024e56241eb1d 100644 (file)
@@ -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,