From 4bf7d60171fb427fac819880c5006d474a2c4871 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 14 May 2009 20:28:11 +0200 Subject: [PATCH] blkid: cleanup debug messages and return codes in blkid_do_probe() Signed-off-by: Karel Zak --- shlibs/blkid/src/probe.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c index af22e34d..38d42762 100644 --- a/shlibs/blkid/src/probe.c +++ b/shlibs/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; } -- 2.39.5