diff options
author | Karel Zak | 2010-09-13 17:06:18 +0200 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:42 +0100 |
commit | 3f31a9593b21dd08b5f4469f9ff88dc12dbfb63d (patch) | |
tree | 5813da0ccbd778cb7e79f42eb39de43aadd1d000 /shlibs/mount/src/tab_update.c | |
parent | libmount: add new psetudo filesystems (diff) | |
download | kernel-qcow2-util-linux-3f31a9593b21dd08b5f4469f9ff88dc12dbfb63d.tar.gz kernel-qcow2-util-linux-3f31a9593b21dd08b5f4469f9ff88dc12dbfb63d.tar.xz kernel-qcow2-util-linux-3f31a9593b21dd08b5f4469f9ff88dc12dbfb63d.zip |
libmount: rewrite DBG() macro
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/tab_update.c')
-rw-r--r-- | shlibs/mount/src/tab_update.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/shlibs/mount/src/tab_update.c b/shlibs/mount/src/tab_update.c index 7b53d63cd..c023777cb 100644 --- a/shlibs/mount/src/tab_update.c +++ b/shlibs/mount/src/tab_update.c @@ -82,8 +82,7 @@ mnt_update *mnt_new_update(int action, unsigned long mountflags, const mnt_fs *f if (!upd) return NULL; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: allocate\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "allocate")); if (action) mnt_update_set_action(upd, action); @@ -105,8 +104,7 @@ void mnt_free_update(mnt_update *upd) if (!upd) return; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: deallacate\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "free")); mnt_free_lock(upd->lc); free(upd->filename); @@ -378,8 +376,7 @@ static int update_file(const char *filename, int fmt, mnt_tab *tb) if (!tb) goto error; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %s: update from tab %p\n", filename, tb)); + DBG(MTAB, mnt_debug("%s: update from tab %p", filename, tb)); if (snprintf(tmpname, sizeof(tmpname), "%s.tmp", filename) >= sizeof(tmpname)) @@ -416,8 +413,7 @@ static int update_file(const char *filename, int fmt, mnt_tab *tb) return 0; error: - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %s: update from tab %p failed\n", filename, tb)); + DBG(MTAB, mnt_debug("%s: update from tab %p failed", filename, tb)); if (f) fclose(f); return -1; @@ -550,9 +546,10 @@ int mnt_prepare_update(mnt_update *upd) if (!upd || !upd->fs) return -1; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: prepare update (target %s, source %s, optstr %s)\n", - upd, mnt_fs_get_target(upd->fs), mnt_fs_get_source(upd->fs), + DBG(MTAB, mnt_debug_h(upd, + "prepare update (target %s, source %s, optstr %s)", + mnt_fs_get_target(upd->fs), + mnt_fs_get_source(upd->fs), mnt_fs_get_optstr(upd->fs))); if (!upd->filename) { @@ -621,18 +618,15 @@ int mnt_prepare_update(mnt_update *upd) goto err; } - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: prepare update: success\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "prepare update: success")); free(u); return 0; err: - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: prepare update: failed\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "prepare update: failed")); free(u); return -1; nothing: - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: prepare update: unnecessary\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "prepare update: unnecessary")); free(u); return 1; } @@ -644,8 +638,8 @@ static int add_entry(mnt_update *upd) assert(upd); - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: add entry\n", upd)); + DBG(MTAB, mnt_debug_h(upd, "add entry")); + if (upd->lc) mnt_lock_file(upd->lc); f = fopen(upd->filename, "a+"); @@ -674,8 +668,7 @@ static int remove_entry(mnt_update *upd) target = mnt_fs_get_target(upd->fs); assert(target); - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: remove entry (target %s)\n", upd, target)); + DBG(MTAB, mnt_debug_h(upd, "remove entry (target %s)", target)); if (upd->lc) mnt_lock_file(upd->lc); @@ -713,8 +706,7 @@ static int modify_target(mnt_update *upd) if (!upd->old_target) return -1; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: modify target (%s->%s)\n", upd, + DBG(MTAB, mnt_debug_h(upd, "modify target (%s->%s)", upd->old_target, mnt_fs_get_target(upd->fs))); if (upd->lc) @@ -749,8 +741,7 @@ static int modify_options(mnt_update *upd) assert(target); assert(upd->filename); - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: modify options (target %s)\n", upd, target)); + DBG(MTAB, mnt_debug_h(upd, "modify options (target %s)", target)); if (upd->lc) mnt_lock_file(upd->lc); @@ -797,8 +788,7 @@ int mnt_update_file(mnt_update *upd) if (!upd || !upd->fs) return -1; - DBG(DEBUG_MTAB, fprintf(stderr, - "libmount: update %p: update (target %s)\n", upd, + DBG(MTAB, mnt_debug_h(upd, "update (target %s)", mnt_fs_get_target(upd->fs))); /* * umount |