From 36374b48f5994303bbd414c567050a929bea2598 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Mon, 21 Jul 2008 22:05:57 +0200 Subject: [PATCH] Libucw: Replace obsolete log calls by msg. --- ucw/kmp-test.c | 2 +- ucw/lfs-test.c | 6 +++--- ucw/log-file.c | 2 +- ucw/mainloop.c | 20 ++++++++++---------- ucw/runcmd.c | 2 +- ucw/threads.c | 2 +- ucw/workqueue.c | 10 +++++----- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ucw/kmp-test.c b/ucw/kmp-test.c index 4e8e3ca8..92b91c76 100644 --- a/ucw/kmp-test.c +++ b/ucw/kmp-test.c @@ -9,7 +9,7 @@ #include #if 0 -#define TRACE(x...) do{log(L_DEBUG, x);}while(0) +#define TRACE(x...) do{msg(L_DEBUG, x);}while(0) #else #define TRACE(x...) do{}while(0) #endif diff --git a/ucw/lfs-test.c b/ucw/lfs-test.c index 07596cbd..8ef657d7 100644 --- a/ucw/lfs-test.c +++ b/ucw/lfs-test.c @@ -25,7 +25,7 @@ int main(void) if (!b) die("Cannot create large-file"); - log(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK); + msg(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK); for (i=0; irpos < fi->rlen) { - log(L_INFO, "Read EOF"); + msg(L_INFO, "Read EOF"); file_del(fi); } else { - log(L_INFO, "Read done"); + msg(L_INFO, "Read done"); file_read(fi, rb, sizeof(rb)); } } static void derror(struct main_file *fi, int cause) { - log(L_INFO, "Error: %m !!! (cause %d)", cause); + msg(L_INFO, "Error: %m !!! (cause %d)", cause); file_del(fi); } static void dwrite(struct main_file *fi UNUSED) { - log(L_INFO, "Write done"); + msg(L_INFO, "Write done"); } static int dhook(struct main_hook *ho UNUSED) { - log(L_INFO, "Hook called"); + msg(L_INFO, "Hook called"); return 0; } static void dtimer(struct main_timer *tm) { - log(L_INFO, "Timer tick"); + msg(L_INFO, "Timer tick"); timer_add(tm, main_now + 10000); } static void dentry(void) { - log(L_INFO, "*** SUBPROCESS START ***"); + msg(L_INFO, "*** SUBPROCESS START ***"); sleep(2); - log(L_INFO, "*** SUBPROCESS FINISH ***"); + msg(L_INFO, "*** SUBPROCESS FINISH ***"); exit(0); } static void dexit(struct main_process *pr) { - log(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status); + msg(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status); } int @@ -539,7 +539,7 @@ main(void) main_debug(); main_loop(); - log(L_INFO, "Finished."); + msg(L_INFO, "Finished."); } #endif diff --git a/ucw/runcmd.c b/ucw/runcmd.c index 9ea0a1a3..9670187d 100644 --- a/ucw/runcmd.c +++ b/ucw/runcmd.c @@ -126,7 +126,7 @@ int main(void) { char msg[1024]; echo_command(msg, sizeof(msg), "/bin/echo", "datel", "strakapoud", NULL); - log(L_INFO, "Running <%s>", msg); + msg(L_INFO, "Running <%s>", msg); run_command("/bin/echo", "datel", "strakapoud", NULL); return 0; } diff --git a/ucw/threads.c b/ucw/threads.c index ec839f8c..1260e875 100644 --- a/ucw/threads.c +++ b/ucw/threads.c @@ -116,7 +116,7 @@ int main(void) { ucwlib_lock(); ucwlib_unlock(); - log(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id); + msg(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id); return 0; } diff --git a/ucw/workqueue.c b/ucw/workqueue.c index 314177b8..83f81def 100644 --- a/ucw/workqueue.c +++ b/ucw/workqueue.c @@ -229,12 +229,12 @@ work_try_wait(struct work_queue *q) static void wt_init(struct worker_thread *t) { - log(L_INFO, "INIT %d", t->id); + msg(L_INFO, "INIT %d", t->id); } static void wt_cleanup(struct worker_thread *t) { - log(L_INFO, "CLEANUP %d", t->id); + msg(L_INFO, "CLEANUP %d", t->id); } struct w { @@ -244,7 +244,7 @@ struct w { static void go(struct worker_thread *t, struct work *w) { - log(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority); + msg(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority); usleep(1); } @@ -267,12 +267,12 @@ int main(void) w->w.priority = (i < 250 ? i : 0); w->id = i; work_submit(&q, &w->w); - log(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority); + msg(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority); } struct w *w; while (w = (struct w *) work_wait(&q)) - log(L_INFO, "Finished request %d", w->id); + msg(L_INFO, "Finished request %d", w->id); work_queue_cleanup(&q); worker_pool_cleanup(&pool); -- 2.39.5