From 65af271ccd9833a6a0872e53b7b7bafacc04c562 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Fri, 16 Jun 2017 11:19:43 +0000 Subject: [PATCH] kernel: pipe io bugfixes git-svn-id: svn://kolibrios.org@6928 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/posix/pipe.inc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/posix/pipe.inc b/kernel/trunk/posix/pipe.inc index 37f094d2df..386509c5fa 100644 --- a/kernel/trunk/posix/pipe.inc +++ b/kernel/trunk/posix/pipe.inc @@ -40,8 +40,8 @@ sys_pipe2: mov ebp, -EINVAL jnz .fail - push ecx push edx + push ecx sub esp, (5-2)*4 mov ecx, sizeof.FILED @@ -102,6 +102,9 @@ sys_pipe2: mov [edx+FILED.destroy], 0 mov [edx+FILED.file], ebp + mov eax, [eax+FILED.handle] + mov edx, [edx+FILED.handle] + mov [ecx], eax mov [ecx+4], edx add esp, 5*4 @@ -220,14 +223,15 @@ pipe_write: jb .write mov ecx, esi .write: - mov esi, [ebp+PIPE.buffer] - add esi, [ebp+PIPE.write_end] + mov esi, edi + mov edi, [ebp+PIPE.buffer] + add edi, [ebp+PIPE.write_end] mov [esp+SYSCALL_STACK._eax], ecx add [ebp+PIPE.count], ecx cld rep movsb - and esi, 0xFFF - mov [ebp+PIPE.write_end], esi + and edi, 0xFFF + mov [ebp+PIPE.write_end], edi lea ecx, [ebp+PIPE.pipe_lock] call mutex_unlock