guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: build: syscalls: Properly handle clone errors.


From: David Thompson
Subject: 01/01: build: syscalls: Properly handle clone errors.
Date: Sat, 05 Sep 2015 17:42:31 +0000

davexunit pushed a commit to branch master
in repository guix.

commit cf897cbacc3ddcf5d5d553ee19002995985fff11
Author: David Thompson <address@hidden>
Date:   Sat Sep 5 13:36:53 2015 -0400

    build: syscalls: Properly handle clone errors.
    
    * guix/build/syscalls.scm (clone): Catch -1 return value and throw error.
---
 guix/build/syscalls.scm |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index fc801a5..093eb0a 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -325,7 +325,13 @@ string TMPL and return its file name.  TMPL must end with 
'XXXXXX'."
       "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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]