fix (processes): changed process spawning to copy the null terminator at the end of the name
This commit is contained in:
parent
8edd425fee
commit
c02fdd7249
|
@ -4,6 +4,7 @@
|
|||
#include "proc/scheduler.h"
|
||||
#include "utils/memory.h"
|
||||
#include "utils/math.h"
|
||||
#include "utils/logger.h"
|
||||
#include "mm/region.h"
|
||||
|
||||
void process_kernel_spawn(elf_executable_T* executable) {
|
||||
|
@ -41,7 +42,7 @@ pid_t process_spawn(pid_t parent, string_t name, elf_executable_T* executable, v
|
|||
process->waiting = bitmap_init(PROCESS_BLOCK_ENUM_SIZE);
|
||||
|
||||
pipe_init(&process->stdin, process, NULL);
|
||||
memory_copy(name, process->name, MIN(string_length(name), 127));
|
||||
memory_copy(name, process->name, MIN(string_length(name)+1, 127));
|
||||
|
||||
process->page_map = page_map_create();
|
||||
elf_mappings_apply(executable->mappings, executable->num_mappings, buffer, MEM_REGION_PROCESS_EXEC, process->page_map);
|
||||
|
|
Loading…
Reference in New Issue