/*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011,
* 2012, 2013, 2015
- * Thorsten Glaser <tg@mirbsd.org>
+ * mirabilos <m@mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
* are retained or reproduced in an accompanying document, permission
#include "sh.h"
-__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.66 2015/07/09 20:52:43 tg Exp $");
+__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.69 2015/12/31 20:38:59 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
switch (errnum) {
case 0:
return ("Undefined error: 0");
-#ifdef EPERM
case EPERM:
return ("Operation not permitted");
-#endif
-#ifdef ENOENT
case ENOENT:
return ("No such file or directory");
-#endif
#ifdef ESRCH
case ESRCH:
return ("No such process");
case E2BIG:
return ("Argument list too long");
#endif
-#ifdef ENOEXEC
case ENOEXEC:
return ("Exec format error");
-#endif
+ case EBADF:
+ return ("Bad file descriptor");
#ifdef ENOMEM
case ENOMEM:
return ("Cannot allocate memory");
#endif
-#ifdef EACCES
case EACCES:
return ("Permission denied");
-#endif
-#ifdef ENOTDIR
+ case EEXIST:
+ return ("File exists");
case ENOTDIR:
return ("Not a directory");
-#endif
#ifdef EINVAL
case EINVAL:
return ("Invalid argument");