From: Andre Noll Date: Fri, 30 Dec 2022 13:47:46 +0000 (+0100) Subject: sched: Improve error diagnostics. X-Git-Tag: v0.7.3~27 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=77e8ab4134501ec439f1ac7c7e1c418ac597ea48 sched: Improve error diagnostics. Currently the error code of the negative return value from ->post_monitor() is not logged anywhere under normal conditions. Instead we log "[dead]" in unlink_and_free_task(). Replace this by a more meaningful message in task_reap(). --- diff --git a/sched.c b/sched.c index c786c9f2..07703f92 100644 --- a/sched.c +++ b/sched.c @@ -62,10 +62,6 @@ static void sched_pre_monitor(struct sched *s) static void unlink_and_free_task(struct task *t) { - PARA_INFO_LOG("freeing task %s (%s)\n", t->name, t->status < 0? - para_strerror(-t->status) : - (t->status == TS_DEAD? "[dead]" : "[running]")); - list_del(&t->node); free(t->name); free(t); @@ -183,6 +179,7 @@ int task_reap(struct task **tptr) if (t->status >= 0) return 0; ret = t->status; + PARA_INFO_LOG("reaping %s (%s)\n", t->name, para_strerror(-ret)); /* * With list_for_each_entry_safe() it is only safe to remove the * _current_ list item. Since we are being called from the loop in