* dynl.c (scm_dynamic_call, scm_dynamic_args_call): Wrap dynamic
[bpt/guile.git] / libguile / dynl-shl.c
index ae32f07..c6c4f97 100644 (file)
@@ -14,7 +14,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
  *
  * As a special exception, the Free Software Foundation gives permission
  * for additional uses of the text contained in its release of GUILE.
@@ -38,8 +39,7 @@
  *
  * If you write modifications of your own for GUILE, it is your choice
  * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  
- */
+ * If you do not wish that, delete this exception notice.  */
 
 /* "dynl.c" dynamically link&load object files.
    Author: Aubrey Jaffer
@@ -61,7 +61,10 @@ sysdep_dynl_link (fname, subr)
                     BIND_TOGETHER ||
                     BIND_VERBOSE || DYNAMIC_PATH, 0L);
     if (NULL==shl)
+      {
+       SCM_ALLOW_INTS;
        scm_misc_error (subr, "dynamic linking failed", SCM_EOL);
+      }
     return shl;
 }
 
@@ -70,13 +73,11 @@ sysdep_dynl_unlink (handle, subr)
      void *handle;
      char *subr;
 {
-    int status;
-
-    SCM_DEFER_INTS;
-    status = shl_unload ((shl_t) handle);
-    SCM_ALLOW_INTS;
-    if (status)
-       scm_misc_error (subr, "dynamic unlinking failed", SCM_EOL);
+  if (shl_unload ((shl_t) handle))
+    {
+      SCM_ALLOW_INTS;
+      scm_misc_error (subr, "dynamic unlinking failed", SCM_EOL);
+    }
 }
 
 static void *
@@ -87,13 +88,15 @@ sysdep_dynl_func (symb, handle, subr)
 {
     int status, i;
     struct shl_symbol *sym;
-    SCM_DEFER_INTS;
+
     status = shl_getsymbols((shl_t) handle, TYPE_PROCEDURE,
              EXPORT_SYMBOLS, malloc, &sym);
-    SCM_ALLOW_INTS;
+
     for (i=0; i<status; ++i) {
       if (strcmp(symb, sym[i].name) == 0) return sym[i].value;
     }
+
+    SCM_ALLOW_INTS;
     scm_misc_error (subr, "undefined function",
                    scm_cons (scm_makfrom0str (symb), SCM_EOL));
 }