Fixed hktask_add not comparing task names if there was only a single task.

This commit is contained in:
Markus Makela 2015-03-05 12:41:09 +02:00
parent 1ff0756044
commit 1299cf6ac9

View File

@ -116,9 +116,20 @@ HKTASK *task, *ptr;
ptr = ptr->next;
}
if (ptr)
{
if (strcmp(ptr->name, name) == 0)
{
spinlock_release(&tasklock);
free(task->name);
free(task);
return 0;
}
ptr->next = task;
}
else
{
tasks = task;
}
spinlock_release(&tasklock);
return task->nextdue;