Added a newline and made the B_ error codes more prominent (removing the POSIX

and NewOS error codes, kept the former as comments).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2690 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-02-11 19:49:58 +00:00
parent 79d76063c3
commit bdd1c86cbb

View File

@ -15,44 +15,38 @@ strerror(int errnum)
{
switch (errnum) {
/* General Errors */
// B_OK
case B_NO_ERROR:
return "No Error";
// B_ERROR
case ERR_GENERAL:
case B_ERROR:
return "General Error";
// B_INTERRUPTED
case EINTR:
case B_INTERRUPTED:
// EINTR
return "Interrupted system call";
// B_NO_MEMORY:
case ENOMEM:
case B_NO_MEMORY:
// ENOMEM
return "Cannot allocate memory"; // "No memory"
// B_IO_ERROR
// EIO
case ERR_IO_ERROR:
case B_IO_ERROR:
// EIO
return "Input/Output error"; // "I/O Error"
// B_BAD_VALUE:
case EINVAL:
case B_BAD_VALUE:
// EINVAL
return "Invalid Argument";
// B_TIMED_OUT
// case ERR_TIMED_OUT:
case ETIMEDOUT:
case B_TIMED_OUT:
// ETIMEDOUT
return "Timed out"; // "Operation timed out"
// B_NOT_ALLOWED
// case ERR_NOT_ALLOWED:
case EPERM:
case B_NOT_ALLOWED:
// EPERM
return "Operation not permitted"; // "Operation not allowed"
// B_PERMISSION_DENIED
// case ERR_PERMISSION_DENIED:
case EACCES:
case B_PERMISSION_DENIED:
// EACCES
return "Operation not permitted"; // "Permission denied"
case ERR_INVALID_BINARY:
@ -61,23 +55,22 @@ strerror(int errnum)
case ERR_INVALID_HANDLE:
return "Invalid ID Handle";
/* EMFILE */
case ERR_NO_MORE_HANDLES:
return "No more handles";
// B_FILE_ERROR
case EBADF:
case B_FILE_ERROR:
// EBADF
return "Bad file descriptor";
// B_ENTRY_NOT_FOUND
case ENOENT:
case B_ENTRY_NOT_FOUND:
// ENOENT
return "No such file or directory";
case ENFILE:
return "Too many open files in system"; // "File table overflow"
// B_NO_MORE_FDS
case EMFILE:
case B_NO_MORE_FDS:
// EMFILE
return "Too many open files";
case ENXIO:
@ -100,7 +93,6 @@ strerror(int errnum)
case ERR_NOT_IMPLEMENTED_YET:
return "Not implemented yet";
/* Semaphore errors */
case B_BAD_SEM_ID:
return "Bad semaphore id";
@ -131,23 +123,19 @@ strerror(int errnum)
case ERR_VFS_PATH_NOT_FOUND:
return "VFS path not found";
// case ERR_VFS_INSUFFICIENT_BUF:
case ENOBUFS:
return "VFS insufficient buffer"; // "No buffer space available"
// B_READ_ONLY_DEVICE
// case ERR_VFS_READONLY_FS:
case EROFS:
case B_READ_ONLY_DEVICE:
// EROFS:
return "VFS readonly filesystem"; // "Read-only file system"
// B_FILE_EXISTS
// case ERR_VFS_ALREADY_EXISTS:
case EEXIST:
case B_FILE_EXISTS:
// EEXIST
return "VFS already exists"; // "File or Directory already exists"
// B_BUSY
// case ERR_VFS_FS_BUSY:
case EBUSY:
case B_BUSY:
// EBUSY
return "Device busy"; // "Device/File/Resource busy"
case ERR_VFS_FD_TABLE_FULL:
@ -159,9 +147,8 @@ strerror(int errnum)
case ERR_VFS_DIR_NOT_EMPTY:
return "Directory not empty";
// B_NOT_A_DIRECTORY
// case ERR_VFS_NOT_DIR:
case ENOTDIR:
case B_NOT_A_DIRECTORY:
// ENOTDIR
return "Not a directory";
case ERR_VFS_WRONG_STREAM_TYPE:
@ -591,10 +578,12 @@ strerror(int errnum)
case B_NOT_A_MESSAGE:
return "Data is not a message";
default: {
default:
{
static char unknown[28];
sprintf(unknown, "Unknown Error (%d)", errnum);
return unknown;
}
}
}
}