diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-09-29 11:37:39 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-09-29 11:37:39 +0000 |
commit | 1c59560de9a5e6baf9bf9668e15a405c914772a0 (patch) | |
tree | b98ee1bc6b1544336b5f69e753b430c3bbbb9f63 /bin/sh/error.c | |
parent | f7f23e15f8a18961c4e0bdb97789f36731c1aed7 (diff) | |
download | src-1c59560de9a5e6baf9bf9668e15a405c914772a0.tar.gz src-1c59560de9a5e6baf9bf9668e15a405c914772a0.zip |
Convert the remaining callers of errmsg() to use strerror(), and remove
errmsg() and its table of error messages.
Notes
Notes:
svn path=/head/; revision=104132
Diffstat (limited to 'bin/sh/error.c')
-rw-r--r-- | bin/sh/error.c | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/bin/sh/error.c b/bin/sh/error.c index 8c2c964a897e..7b00c8b7cc81 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; -} |