]> git.lizzy.rs Git - plan9front.git/commit
libthread: use devdup instead of mounting pipe to /mnt/temp for close-on-exec in...
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sat, 28 Feb 2015 11:50:17 +0000 (12:50 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sat, 28 Feb 2015 11:50:17 +0000 (12:50 +0100)
commit45d1d31847dfc425410a107b66537e567c0d5637
treeabd032eae3933f8ad533e962653d23f94a3e06b1
parent1d2ce3583ec377f16a1f801f624344de99bc9ddc
libthread: use devdup instead of mounting pipe to /mnt/temp for close-on-exec in procexec()

the namespace might be shared by other processes. instead, we
create a anonymous pipe with pipe() and use devdup to open one
end close-on-exec. this is shorter and avoids the race condition.

do not touch Execargs after writing the error message as the
process might be gone after the write. this was to manually
close the fd which isnt neccesary as the kernel will do it
for us on the following exit.
sys/man/2/thread
sys/src/libthread/exec.c
sys/src/libthread/main.c