Skip to content
Snippets Groups Projects
Commit cf897cba authored by David Thompson's avatar David Thompson
Browse files

build: syscalls: Properly handle clone errors.

* guix/build/syscalls.scm (clone): Catch -1 return value and throw error.
parent b7d0b096
No related branches found
No related tags found
No related merge requests found
......@@ -325,7 +325,13 @@ (define clone
"Create a new child process by duplicating the current parent process.
Unlike the fork system call, clone accepts FLAGS that specify which resources
are shared between the parent and child processes."
(proc syscall-id flags %null-pointer))))
(let ((ret (proc syscall-id flags %null-pointer))
(err (errno)))
(if (= ret -1)
(throw 'system-error "clone" "~d: ~A"
(list flags (strerror err))
(list err))
ret)))))
(define setns
;; Some systems may be using an old (pre-2.14) version of glibc where there
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment