From: Karel Zak Date: Thu, 14 May 2009 18:28:11 +0000 (+0200) Subject: blkid: cleanup debug messages and return codes in blkid_do_probe() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7f1de581a7933e4a791793e267036c35ae52da3;p=util-linux blkid: cleanup debug messages and return codes in blkid_do_probe() Signed-off-by: Karel Zak --- diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index af22e34d..38d42762 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -453,17 +453,16 @@ int blkid_do_probe(blkid_probe pr) { int i = 0; - if (!pr) + if (!pr || pr->idx < -1) return -1; blkid_probe_reset_vals(pr); - i = pr->idx + 1; + DBG(DEBUG_LOWPROBE, + printf("--> starting probing loop [idx=%d]\n", + pr->idx)); - if (i < 0 && i >= ARRAY_SIZE(idinfos)) - return -1; - - DBG(DEBUG_LOWPROBE, printf("--> starting probing loop\n")); + i = pr->idx + 1; for ( ; i < ARRAY_SIZE(idinfos); i++) { const struct blkid_idinfo *id; @@ -518,10 +517,13 @@ int blkid_do_probe(blkid_probe pr) blkid_probe_set_usage(pr, id->usage); DBG(DEBUG_LOWPROBE, - printf("<-- leaving probing loop (type=%s)\n", id->name)); + printf("<-- leaving probing loop (type=%s) [idx=%d]\n", + id->name, pr->idx)); return 0; } - DBG(DEBUG_LOWPROBE, printf("<-- leaving probing loop (failed)\n")); + DBG(DEBUG_LOWPROBE, + printf("<-- leaving probing loop (failed) [idx=%d]\n", + pr->idx)); return 1; }