summaryrefslogtreecommitdiffstats
path: root/bin/sh/error.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-09-29 11:37:39 +0000
committertjr <tjr@FreeBSD.org>2002-09-29 11:37:39 +0000
commit6307190b53a87478b299a91b61de89cb11d9be6e (patch)
treeb98ee1bc6b1544336b5f69e753b430c3bbbb9f63 /bin/sh/error.c
parent89c5289c522dcbfe7a37ea4c076f10888e6ed771 (diff)
downloadFreeBSD-src-6307190b53a87478b299a91b61de89cb11d9be6e.zip
FreeBSD-src-6307190b53a87478b299a91b61de89cb11d9be6e.tar.gz
Convert the remaining callers of errmsg() to use strerror(), and remove
errmsg() and its table of error messages.
Diffstat (limited to 'bin/sh/error.c')
-rw-r--r--bin/sh/error.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/bin/sh/error.c b/bin/sh/error.c
index 8c2c964..7b00c8b 100644
--- a/bin/sh/error.c
+++ b/bin/sh/error.c
@@ -180,91 +180,3 @@ exerror(int cond, const char *msg, ...)
exverror(cond, msg, ap);
va_end(ap);
}
-
-
-
-/*
- * Table of error messages.
- */
-
-struct errname {
- short errcode; /* error number */
- short action; /* operation which encountered the error */
- char *msg; /* text describing the error */
-};
-
-
-#define ALL (E_OPEN|E_CREAT|E_EXEC)
-
-STATIC const struct errname errormsg[] = {
- { EINTR, ALL, "interrupted" },
- { EACCES, ALL, "permission denied" },
- { EIO, ALL, "I/O error" },
- { ENOENT, E_OPEN, "no such file" },
- { ENOENT, E_CREAT,"directory nonexistent" },
- { ENOENT, E_EXEC, "not found" },
- { ENOTDIR, E_OPEN, "no such file" },
- { ENOTDIR, E_CREAT,"directory nonexistent" },
- { ENOTDIR, E_EXEC, "not found" },
- { EISDIR, ALL, "is a directory" },
-#ifdef notdef
- { EMFILE, ALL, "too many open files" },
-#endif
- { ENFILE, ALL, "file table overflow" },
- { ENOSPC, ALL, "file system full" },
-#ifdef EDQUOT
- { EDQUOT, ALL, "disk quota exceeded" },
-#endif
-#ifdef ENOSR
- { ENOSR, ALL, "no streams resources" },
-#endif
- { ENXIO, ALL, "no such device or address" },
- { EROFS, ALL, "read-only file system" },
- { ETXTBSY, ALL, "text busy" },
- { ENOMEM, ALL, "not enough memory" },
-#ifdef ENOLINK
- { ENOLINK, ALL, "remote access failed" },
-#endif
-#ifdef EMULTIHOP
- { EMULTIHOP, ALL, "remote access failed" },
-#endif
-#ifdef ECOMM
- { ECOMM, ALL, "remote access failed" },
-#endif
-#ifdef ESTALE
- { ESTALE, ALL, "remote access failed" },
-#endif
-#ifdef ETIMEDOUT
- { ETIMEDOUT, ALL, "remote access failed" },
-#endif
-#ifdef ELOOP
- { ELOOP, ALL, "symbolic link loop" },
-#endif
- { E2BIG, E_EXEC, "argument list too long" },
-#ifdef ELIBACC
- { ELIBACC, E_EXEC, "shared library missing" },
-#endif
- { EEXIST, E_CREAT, "file exists" },
- { 0, 0, NULL },
-};
-
-
-/*
- * Return a string describing an error. The returned string may be a
- * pointer to a static buffer that will be overwritten on the next call.
- * Action describes the operation that got the error.
- */
-
-char *
-errmsg(int e, int action)
-{
- struct errname const *ep;
- static char buf[12];
-
- for (ep = errormsg ; ep->errcode ; ep++) {
- if (ep->errcode == e && (ep->action & action) != 0)
- return ep->msg;
- }
- fmtstr(buf, sizeof buf, "error %d", e);
- return buf;
-}
OpenPOWER on IntegriCloud