diff options
Diffstat (limited to 'nsprpub/pr/src/md/unix/unix_errors.c')
-rw-r--r-- | nsprpub/pr/src/md/unix/unix_errors.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/nsprpub/pr/src/md/unix/unix_errors.c b/nsprpub/pr/src/md/unix/unix_errors.c index bcea0993f3..1d87659699 100644 --- a/nsprpub/pr/src/md/unix/unix_errors.c +++ b/nsprpub/pr/src/md/unix/unix_errors.c @@ -29,9 +29,9 @@ void _MD_unix_map_default_error(int err) case EAGAIN: prError = PR_WOULD_BLOCK_ERROR; break; - /* - * On QNX and Neutrino, EALREADY is defined as EBUSY. - */ + /* + * On QNX and Neutrino, EALREADY is defined as EBUSY. + */ #if EALREADY != EBUSY case EALREADY: prError = PR_ALREADY_INITIATED_ERROR; @@ -127,9 +127,9 @@ void _MD_unix_map_default_error(int err) case ENFILE: prError = PR_SYS_DESC_TABLE_FULL_ERROR; break; - /* - * On SCO OpenServer 5, ENOBUFS is defined as ENOSR. - */ + /* + * On SCO OpenServer 5, ENOBUFS is defined as ENOSR. + */ #if defined(ENOBUFS) && (ENOBUFS != ENOSR) case ENOBUFS: prError = PR_INSUFFICIENT_RESOURCES_ERROR; @@ -144,7 +144,7 @@ void _MD_unix_map_default_error(int err) case ENOLCK: prError = PR_FILE_IS_LOCKED_ERROR; break; -#ifdef ENOLINK +#ifdef ENOLINK case ENOLINK: prError = PR_REMOTE_FILE_ERROR; break; @@ -362,9 +362,9 @@ void _MD_unix_map_rmdir_error(int err) PRErrorCode prError; switch (err) { - /* - * On AIX 4.3, ENOTEMPTY is defined as EEXIST. - */ + /* + * On AIX 4.3, ENOTEMPTY is defined as EEXIST. + */ #if ENOTEMPTY != EEXIST case ENOTEMPTY: prError = PR_DIRECTORY_NOT_EMPTY_ERROR; @@ -530,8 +530,8 @@ void _MD_unix_map_connect_error(int err) switch (err) { #if defined(UNIXWARE) /* - * On some platforms, if we connect to a port on the local host - * (the loopback address) that no process is listening on, we get + * On some platforms, if we connect to a port on the local host + * (the loopback address) that no process is listening on, we get * EIO instead of ECONNREFUSED. */ case EIO: @@ -738,14 +738,18 @@ void _MD_unix_map_poll_error(int err) void _MD_unix_map_poll_revents_error(int err) { - if (err & POLLNVAL) + if (err & POLLNVAL) { PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); - else if (err & POLLHUP) + } + else if (err & POLLHUP) { PR_SetError(PR_CONNECT_RESET_ERROR, EPIPE); - else if (err & POLLERR) + } + else if (err & POLLERR) { PR_SetError(PR_IO_ERROR, EIO); - else + } + else { PR_SetError(PR_UNKNOWN_ERROR, err); + } } #endif /* _PR_POLL_AVAILABLE || _PR_NEED_FAKE_POLL */ |