Update redbean lua example code

This commit is contained in:
Justine Tunney 2022-04-25 09:31:28 -07:00
parent 451e3f73d9
commit 72e9be5c20
7 changed files with 56 additions and 51 deletions

View file

@ -8,14 +8,14 @@ function main()
cmd = 'ls'
end
syscall = 'commandv'
ls, errno = unix.commandv(cmd)
ls = assert(unix.commandv(cmd))
if ls then
syscall = 'pipe'
reader, writer, errno = unix.pipe()
if reader then
oldint = unix.sigaction(unix.SIGINT, unix.SIG_IGN)
oldquit = unix.sigaction(unix.SIGQUIT, unix.SIG_IGN)
oldmask = unix.sigprocmask(unix.SIG_BLOCK, (1 << (unix.SIGCHLD - 1)))
-- oldint = assert(unix.sigaction(unix.SIGINT, unix.SIG_IGN))
-- oldquit = assert(unix.sigaction(unix.SIGQUIT, unix.SIG_IGN))
-- oldmask = assert(unix.sigprocmask(unix.SIG_BLOCK, (1 << (unix.SIGCHLD - 1))))
syscall = 'fork'
child, errno = unix.fork()
if child then