enable debugging functions when taskdebuglevel is set

This commit is contained in:
David du Colombier 2014-08-03 18:43:01 +02:00
parent b0c00d19fb
commit 0d454584f8

11
task.c
View File

@ -31,11 +31,12 @@ taskdebug(char *fmt, ...)
char *p;
static int fd = -1;
return;
if(taskdebuglevel == 0)
return;
va_start(arg, fmt);
vfprint(1, fmt, arg);
va_end(arg);
return;
if(fd < 0){
p = strrchr(argv0, '/');
@ -278,6 +279,9 @@ taskname(char *fmt, ...)
va_list arg;
Task *t;
if(taskdebuglevel == 0)
return;
t = taskrunning;
va_start(arg, fmt);
vsnprint(t->name, sizeof t->name, fmt, arg);
@ -296,6 +300,9 @@ taskstate(char *fmt, ...)
va_list arg;
Task *t;
if(taskdebuglevel == 0)
return;
t = taskrunning;
va_start(arg, fmt);
vsnprint(t->state, sizeof t->name, fmt, arg);