X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fthreads.c;h=ba0f430db5eb84de47ec034f929124dff89a7b0c;hb=368c14e71abbef4d1a5863330312b80bfeb2ea7c;hp=a947169d6306c5ecfe55fded86cf212b846eceb9;hpb=dea6bcf35a3f52396724d74e47f71cb3afade37c;p=tpg%2Facess2.git diff --git a/Kernel/threads.c b/Kernel/threads.c index a947169d..ba0f430d 100644 --- a/Kernel/threads.c +++ b/Kernel/threads.c @@ -173,6 +173,7 @@ tThread *Threads_CloneTCB(Uint *Err, Uint Flags) *Err = -ENOMEM; return NULL; } + memcpy(new, cur, sizeof(tThread)); new->Next = NULL; new->IsLocked = 0; @@ -184,8 +185,7 @@ tThread *Threads_CloneTCB(Uint *Err, Uint Flags) new->PTID = cur->TID; // Clone Name - new->ThreadName = malloc(strlen(cur->ThreadName)+1); - strcpy(new->ThreadName, cur->ThreadName); + new->ThreadName = strdup(cur->ThreadName); // Set Thread Group ID (PID) if(Flags & CLONE_VM)