diff src/eval.c @ 149:538048ae2ab8 r20-3b1

Import from CVS: tag r20-3b1
author cvs
date Mon, 13 Aug 2007 09:36:16 +0200
parents 9f59509498e1
children 25f70ba0133c
line wrap: on
line diff
--- a/src/eval.c	Mon Aug 13 09:35:15 2007 +0200
+++ b/src/eval.c	Mon Aug 13 09:36:16 2007 +0200
@@ -2485,6 +2485,18 @@
 }
 
 
+DEFUN ("strerror", Fstrerror, 1, 1, 0, /*
+Return the error string associated with integer ERRNUM.
+This function is an interface to strerror(3).
+The returned string may or may not be translated.
+*/
+       (errnum))
+{
+  CHECK_INT (errnum);
+  return build_ext_string (strerror (XINT (errnum)), FORMAT_NATIVE);
+}
+
+
 /**********************************************************************/
 /*                            User commands                           */
 /**********************************************************************/
@@ -2521,17 +2533,10 @@
   /* Emacs primitives are interactive if their DEFUN specifies an
      interactive spec.  */
   if (SUBRP (fun))
-    {
-      if (XSUBR (fun)->prompt)
-	return Qt;
-      else
-	return Qnil;
-    }
-
-  else if (COMPILED_FUNCTIONP (fun))
-    {
-      return (((XCOMPILED_FUNCTION (fun)->flags.interactivep) ? Qt : Qnil));
-    }
+    return XSUBR (fun)->prompt ? Qt : Qnil;
+
+  if (COMPILED_FUNCTIONP (fun))
+    return XCOMPILED_FUNCTION (fun)->flags.interactivep ? Qt : Qnil;
 
   /* Strings and vectors are keyboard macros.  */
   if (VECTORP (fun) || STRINGP (fun))
@@ -5134,6 +5139,7 @@
   DEFSUBR (Fcall_with_condition_handler);
   DEFSUBR (Fsignal);
   DEFSUBR (Finteractive_p);
+  DEFSUBR (Fstrerror);
   DEFSUBR (Fcommandp);
   DEFSUBR (Fcommand_execute);
   DEFSUBR (Fautoload);