guix-commits
[Top][All Lists]
Advanced

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

01/01: linux-modules: Correctly propagate error code from 'init_module'.


From: Ludovic Courtès
Subject: 01/01: linux-modules: Correctly propagate error code from 'init_module'.
Date: Fri, 28 Nov 2014 16:51:18 +0000

civodul pushed a commit to branch master
in repository guix.

commit 7c4885f0d79593cb0f3a7981444f611d7ced54b9
Author: Ludovic Courtès <address@hidden>
Date:   Fri Nov 28 15:08:56 2014 +0100

    linux-modules: Correctly propagate error code from 'init_module'.
    
    * gnu/packages/patches/guile-linux-syscalls.patch (scm_load_linux_module):
      Leave 'errno' unchanged when ERR != 0.
    * gnu/build/linux-modules.scm (load-linux-module*): Check for the errno
      value of ARGS to determine whether the module was already loaded.
---
 gnu/build/linux-modules.scm                     |    6 +-----
 gnu/packages/patches/guile-linux-syscalls.patch |    9 ++-------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 0fa09b2..a3bc7d6 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -160,11 +160,7 @@ module name."
     (lambda args
       ;; If this module was already loaded and we're in modprobe style, ignore
       ;; the error.
-
-      ;; FIXME: Use errno once 'guile-linux-syscalls.patch' provides a useful
-      ;; errno here.
-      (unless (and recursive?
-                   (module-loaded? (string-drop-right (basename file) 3)))
+      (unless (and recursive? (= EEXIST (system-error-errno args)))
         (apply throw args)))))
 
 ;;; linux-modules.scm ends here
diff --git a/gnu/packages/patches/guile-linux-syscalls.patch 
b/gnu/packages/patches/guile-linux-syscalls.patch
index 1fb24bd..57c7f25 100644
--- a/gnu/packages/patches/guile-linux-syscalls.patch
+++ b/gnu/packages/patches/guile-linux-syscalls.patch
@@ -7,7 +7,7 @@ diff --git a/libguile/posix.c b/libguile/posix.c
 index 324f21b..cbee94d 100644
 --- a/libguile/posix.c
 +++ b/libguile/posix.c
-@@ -2286,6 +2286,266 @@ scm_init_popen (void)
+@@ -2286,6 +2286,261 @@ scm_init_popen (void)
  }
  #endif
  
@@ -84,12 +84,7 @@ index 324f21b..cbee94d 100644
 +  free (c_options);
 +
 +  if (err != 0)
-+    {
-+      /* XXX: `insmod' actually provides better translation of some of
-+       the error codes.  */
-+      errno = err;
-+      SCM_SYSERROR;
-+    }
++    SCM_SYSERROR;
 +
 +  return SCM_UNSPECIFIED;
 +}



reply via email to

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