summaryrefslogtreecommitdiffstats
path: root/libblkid/src/topology
diff options
context:
space:
mode:
authorKarel Zak2013-04-08 18:22:13 +0200
committerKarel Zak2013-04-08 18:22:13 +0200
commit0540ea544d4b459bc148d29645225190b76ca8b7 (patch)
treef0902ec8cb04f8148ffd87170c2f1bdd7534564e /libblkid/src/topology
parentbash-completion: Symlink runuser symlink to su so it gets loaded on demand. (diff)
downloadkernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.tar.gz
kernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.tar.xz
kernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.zip
libblkid: clean up DBG()
- use stderr only - use BLKID_ prefix for debug masks - don't use \n in in messages and don't use printf(), but use generic blkid_debug(). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/topology')
-rw-r--r--libblkid/src/topology/dm.c9
-rw-r--r--libblkid/src/topology/lvm.c9
-rw-r--r--libblkid/src/topology/topology.c14
3 files changed, 11 insertions, 21 deletions
diff --git a/libblkid/src/topology/dm.c b/libblkid/src/topology/dm.c
index dd058536c..42a2f2f7e 100644
--- a/libblkid/src/topology/dm.c
+++ b/libblkid/src/topology/dm.c
@@ -57,8 +57,7 @@ static int probe_dm_tp(blkid_probe pr,
if (!cmd)
goto nothing;
if (pipe(dmpipe) < 0) {
- DBG(DEBUG_LOWPROBE,
- printf("Failed to open pipe: errno=%d", errno));
+ DBG(LOWPROBE, blkid_debug("Failed to open pipe: errno=%d", errno));
goto nothing;
}
@@ -92,13 +91,11 @@ static int probe_dm_tp(blkid_probe pr,
execv(dmargv[0], dmargv);
- DBG(DEBUG_LOWPROBE,
- printf("Failed to execute %s: errno=%d", cmd, errno));
+ DBG(LOWPROBE, blkid_debug("Failed to execute %s: errno=%d", cmd, errno));
exit(1);
}
case -1:
- DBG(DEBUG_LOWPROBE,
- printf("Failed to forking: errno=%d", errno));
+ DBG(LOWPROBE, blkid_debug("Failed to forking: errno=%d", errno));
goto nothing;
default:
break;
diff --git a/libblkid/src/topology/lvm.c b/libblkid/src/topology/lvm.c
index d5bce28fb..71097a5a4 100644
--- a/libblkid/src/topology/lvm.c
+++ b/libblkid/src/topology/lvm.c
@@ -67,8 +67,7 @@ static int probe_lvm_tp(blkid_probe pr,
goto nothing;
if (pipe(lvpipe) < 0) {
- DBG(DEBUG_LOWPROBE,
- printf("Failed to open pipe: errno=%d", errno));
+ DBG(LOWPROBE, blkid_debug("Failed to open pipe: errno=%d", errno));
goto nothing;
}
@@ -95,13 +94,11 @@ static int probe_lvm_tp(blkid_probe pr,
execv(lvargv[0], lvargv);
- DBG(DEBUG_LOWPROBE,
- printf("Failed to execute %s: errno=%d", cmd, errno));
+ DBG(LOWPROBE, blkid_debug("Failed to execute %s: errno=%d", cmd, errno));
exit(1);
}
case -1:
- DBG(DEBUG_LOWPROBE,
- printf("Failed to forking: errno=%d", errno));
+ DBG(LOWPROBE, blkid_debug("Failed to forking: errno=%d", errno));
goto nothing;
default:
break;
diff --git a/libblkid/src/topology/topology.c b/libblkid/src/topology/topology.c
index 9d4e7bdf1..75cb7dd50 100644
--- a/libblkid/src/topology/topology.c
+++ b/libblkid/src/topology/topology.c
@@ -153,7 +153,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
return -1; /* nothing, works with block devices only */
if (chn->binary) {
- DBG(DEBUG_LOWPROBE, printf("initialize topology binary data\n"));
+ DBG(LOWPROBE, blkid_debug("initialize topology binary data"));
if (chn->data)
/* reset binary data */
@@ -169,8 +169,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
blkid_probe_chain_reset_vals(pr, chn);
- DBG(DEBUG_LOWPROBE,
- printf("--> starting probing loop [TOPOLOGY idx=%d]\n",
+ DBG(LOWPROBE, blkid_debug("--> starting probing loop [TOPOLOGY idx=%d]",
chn->idx));
i = chn->idx < 0 ? 0 : chn->idx + 1U;
@@ -181,8 +180,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
chn->idx = i;
if (id->probefunc) {
- DBG(DEBUG_LOWPROBE, printf(
- "%s: call probefunc()\n", id->name));
+ DBG(LOWPROBE, blkid_debug("%s: call probefunc()", id->name));
if (id->probefunc(pr, NULL) != 0)
continue;
}
@@ -193,14 +191,12 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
/* generic for all probing drivers */
topology_set_logical_sector_size(pr);
- DBG(DEBUG_LOWPROBE,
- printf("<-- leaving probing loop (type=%s) [TOPOLOGY idx=%d]\n",
+ DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [TOPOLOGY idx=%d]",
id->name, chn->idx));
return 0;
}
- DBG(DEBUG_LOWPROBE,
- printf("<-- leaving probing loop (failed) [TOPOLOGY idx=%d]\n",
+ DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed) [TOPOLOGY idx=%d]",
chn->idx));
return 1;
}