summaryrefslogtreecommitdiffstats
path: root/lace_x86.asm
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-01-14 21:44:22 -0500
committerMalfurious <m@lfurio.us>2023-01-14 21:44:22 -0500
commit7e8e439a6940bde2c11d30e45b950dd3ed789e60 (patch)
tree62ef5e0124e98875676350c0496d37f63fd124dd /lace_x86.asm
parent658c9a0d0d5c01b28bd7c7f52b79d304cc97dfdf (diff)
downloadlace-7e8e439a6940bde2c11d30e45b950dd3ed789e60.tar.gz
lace-7e8e439a6940bde2c11d30e45b950dd3ed789e60.zip
Write to stdout instead of stdin
The previous version breaks if stdin is directed from a file, such as /dev/null. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'lace_x86.asm')
-rw-r--r--lace_x86.asm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lace_x86.asm b/lace_x86.asm
index ee615ea..687b8e0 100644
--- a/lace_x86.asm
+++ b/lace_x86.asm
@@ -116,10 +116,11 @@ _start:
pop edi ; recover socket fd
sub esp, 0xff ; alloc data buffer
- xor esi, esi ; pipe(sock, stdin)
+ xor esi, esi ; pipe(sock_fd, stdin)
call pipe
- xchg edi, esi ; pipe(stdin, sock)
+ inc esi ; pipe(stdout, sock_fd)
+ xchg edi, esi
call pipe
xor ebx, ebx ; exit(0)