diff options
author | Karel Zak | 2013-04-08 18:22:13 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-08 18:22:13 +0200 |
commit | 0540ea544d4b459bc148d29645225190b76ca8b7 (patch) | |
tree | f0902ec8cb04f8148ffd87170c2f1bdd7534564e /libblkid/src/devno.c | |
parent | bash-completion: Symlink runuser symlink to su so it gets loaded on demand. (diff) | |
download | kernel-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/devno.c')
-rw-r--r-- | libblkid/src/devno.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libblkid/src/devno.c b/libblkid/src/devno.c index cdf3d5bfc..56f4531a5 100644 --- a/libblkid/src/devno.c +++ b/libblkid/src/devno.c @@ -131,8 +131,7 @@ void blkid__scan_dir(char *dirname, dev_t devno, struct dir_list **list, if (S_ISBLK(st.st_mode) && st.st_rdev == devno) { *devname = blkid_strconcat(dirname, "/", dp->d_name); - DBG(DEBUG_DEVNO, - printf("found 0x%llx at %s\n", (long long)devno, + DBG(DEVNO, blkid_debug("found 0x%llx at %s", (long long)devno, *devname)); break; } @@ -194,7 +193,7 @@ static char *scandev_devno_to_devpath(dev_t devno) struct dir_list *current = list; list = list->next; - DBG(DEBUG_DEVNO, printf("directory %s\n", current->name)); + DBG(DEVNO, blkid_debug("directory %s", current->name)); blkid__scan_dir(current->name, devno, &new_list, &devname); free(current->name); free(current); @@ -237,12 +236,10 @@ char *blkid_devno_to_devname(dev_t devno) path = scandev_devno_to_devpath(devno); if (!path) { - DBG(DEBUG_DEVNO, - printf("blkid: couldn't find devno 0x%04lx\n", + DBG(DEVNO, blkid_debug("blkid: couldn't find devno 0x%04lx", (unsigned long) devno)); } else { - DBG(DEBUG_DEVNO, - printf("found devno 0x%04llx as %s\n", (long long)devno, path)); + DBG(DEVNO, blkid_debug("found devno 0x%04llx as %s", (long long)devno, path)); } return path; @@ -324,7 +321,7 @@ int blkid_driver_has_major(const char *drvname, int major) fclose(f); - DBG(DEBUG_DEVNO, printf("major %d %s associated with '%s' driver\n", + DBG(DEVNO, blkid_debug("major %d %s associated with '%s' driver", major, match ? "is" : "is NOT", drvname)); return match; } @@ -339,7 +336,7 @@ int main(int argc, char** argv) dev_t devno, disk_devno; const char *errmsg = "Couldn't parse %s: %s\n"; - blkid_init_debug(DEBUG_ALL); + blkid_init_debug(BLKID_DEBUG_ALL); if ((argc != 2) && (argc != 3)) { fprintf(stderr, "Usage:\t%s device_number\n\t%s major minor\n" "Resolve a device number to a device name\n", |