Back to index

lightning-sunbird  0.9+nobinonly
unix_err.c
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file essentially replicates NSPR's source for the functions that
00004  * map system-specific error codes to NSPR error codes.  We would use 
00005  * NSPR's functions, instead of duplicating them, but they're private.
00006  * As long as SSL's server session cache code must do platform native I/O
00007  * to accomplish its job, and NSPR's error mapping functions remain private,
00008  * this code will continue to need to be replicated.
00009  * 
00010  * ***** BEGIN LICENSE BLOCK *****
00011  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00012  *
00013  * The contents of this file are subject to the Mozilla Public License Version
00014  * 1.1 (the "License"); you may not use this file except in compliance with
00015  * the License. You may obtain a copy of the License at
00016  * http://www.mozilla.org/MPL/
00017  *
00018  * Software distributed under the License is distributed on an "AS IS" basis,
00019  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00020  * for the specific language governing rights and limitations under the
00021  * License.
00022  *
00023  * The Original Code is the Netscape security libraries.
00024  *
00025  * The Initial Developer of the Original Code is
00026  * Netscape Communications Corporation.
00027  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00028  * the Initial Developer. All Rights Reserved.
00029  *
00030  * Contributor(s):
00031  *
00032  * Alternatively, the contents of this file may be used under the terms of
00033  * either the GNU General Public License Version 2 or later (the "GPL"), or
00034  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00035  * in which case the provisions of the GPL or the LGPL are applicable instead
00036  * of those above. If you wish to allow use of your version of this file only
00037  * under the terms of either the GPL or the LGPL, and not to allow others to
00038  * use your version of this file under the terms of the MPL, indicate your
00039  * decision by deleting the provisions above and replace them with the notice
00040  * and other provisions required by the GPL or the LGPL. If you do not delete
00041  * the provisions above, a recipient may use your version of this file under
00042  * the terms of any one of the MPL, the GPL or the LGPL.
00043  *
00044  * ***** END LICENSE BLOCK ***** */
00045 /* $Id: unix_err.c,v 1.8 2004/04/27 23:04:39 gerv%gerv.net Exp $ */
00046 
00047 #if 0
00048 #include "primpl.h"
00049 #else
00050 #define _PR_POLL_AVAILABLE 1
00051 #include "prerror.h"
00052 #endif
00053 
00054 #if defined (__bsdi__) || defined(NTO) || defined(DARWIN) || defined(BEOS)
00055 #undef _PR_POLL_AVAILABLE
00056 #endif
00057 
00058 #if defined(_PR_POLL_AVAILABLE)
00059 #include <poll.h>
00060 #endif
00061 #include <errno.h>
00062 
00063 /* forward declarations. */
00064 void nss_MD_unix_map_default_error(int err);
00065 
00066 void nss_MD_unix_map_opendir_error(int err)
00067 {
00068     nss_MD_unix_map_default_error(err);
00069 }
00070 
00071 void nss_MD_unix_map_closedir_error(int err)
00072 {
00073     PRErrorCode prError;
00074     switch (err) {
00075     case EINVAL:     prError = PR_BAD_DESCRIPTOR_ERROR; break;
00076     default:         nss_MD_unix_map_default_error(err); return;
00077     }
00078     PR_SetError(prError, err);
00079 }
00080 
00081 void nss_MD_unix_readdir_error(int err)
00082 {
00083     PRErrorCode prError;
00084 
00085     switch (err) {
00086     case ENOENT:     prError = PR_NO_MORE_FILES_ERROR; break;
00087 #ifdef EOVERFLOW
00088     case EOVERFLOW:  prError = PR_IO_ERROR; break;
00089 #endif
00090     case EINVAL:     prError = PR_IO_ERROR; break;
00091     case ENXIO:             prError = PR_IO_ERROR; break;
00092     default:         nss_MD_unix_map_default_error(err); return;
00093     }
00094     PR_SetError(prError, err);
00095 }
00096 
00097 void nss_MD_unix_map_unlink_error(int err)
00098 {
00099     PRErrorCode prError;
00100     switch (err) {
00101     case EPERM:             prError = PR_IS_DIRECTORY_ERROR; break;
00102     default:         nss_MD_unix_map_default_error(err); return;
00103     }
00104     PR_SetError(prError, err);
00105 }
00106 
00107 void nss_MD_unix_map_stat_error(int err)
00108 {
00109     PRErrorCode prError;
00110     switch (err) {
00111     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00112     default:         nss_MD_unix_map_default_error(err); return;
00113     }
00114     PR_SetError(prError, err);
00115 }
00116 
00117 void nss_MD_unix_map_fstat_error(int err)
00118 {
00119     PRErrorCode prError;
00120     switch (err) {
00121     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00122     default:         nss_MD_unix_map_default_error(err); return;
00123     }
00124     PR_SetError(prError, err);
00125 }
00126 
00127 void nss_MD_unix_map_rename_error(int err)
00128 {
00129     PRErrorCode prError;
00130     switch (err) {
00131     case EEXIST:     prError = PR_DIRECTORY_NOT_EMPTY_ERROR; break;
00132     default:         nss_MD_unix_map_default_error(err); return;
00133     }
00134     PR_SetError(prError, err);
00135 }
00136 
00137 void nss_MD_unix_map_access_error(int err)
00138 {
00139     PRErrorCode prError;
00140     switch (err) {
00141     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00142     default:         nss_MD_unix_map_default_error(err); return;
00143     }
00144     PR_SetError(prError, err);
00145 }
00146 
00147 void nss_MD_unix_map_mkdir_error(int err)
00148 {
00149     nss_MD_unix_map_default_error(err);
00150 }
00151 
00152 void nss_MD_unix_map_rmdir_error(int err)
00153 {
00154     PRErrorCode prError;
00155 
00156     switch (err) {
00157     case EEXIST:     prError = PR_DIRECTORY_NOT_EMPTY_ERROR; break;
00158     case EINVAL:     prError = PR_DIRECTORY_NOT_EMPTY_ERROR; break;
00159     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00160     default:         nss_MD_unix_map_default_error(err); return;
00161     }
00162     PR_SetError(prError, err);
00163 }
00164 
00165 void nss_MD_unix_map_read_error(int err)
00166 {
00167     PRErrorCode prError;
00168     switch (err) {
00169     case EINVAL:     prError = PR_INVALID_METHOD_ERROR; break;
00170     case ENXIO:             prError = PR_INVALID_ARGUMENT_ERROR; break;
00171     default:         nss_MD_unix_map_default_error(err); return;
00172     }
00173     PR_SetError(prError, err);
00174 }
00175 
00176 void nss_MD_unix_map_write_error(int err)
00177 {
00178     PRErrorCode prError;
00179     switch (err) {
00180     case EINVAL:     prError = PR_INVALID_METHOD_ERROR; break;
00181     case ENXIO:             prError = PR_INVALID_METHOD_ERROR; break;
00182     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00183     default:         nss_MD_unix_map_default_error(err); return;
00184     }
00185     PR_SetError(prError, err);
00186 }
00187 
00188 void nss_MD_unix_map_lseek_error(int err)
00189 {
00190     nss_MD_unix_map_default_error(err);
00191 }
00192 
00193 void nss_MD_unix_map_fsync_error(int err)
00194 {
00195     PRErrorCode prError;
00196     switch (err) {
00197     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00198     case EINVAL:     prError = PR_INVALID_METHOD_ERROR; break;
00199     default:         nss_MD_unix_map_default_error(err); return;
00200     }
00201     PR_SetError(prError, err);
00202 }
00203 
00204 void nss_MD_unix_map_close_error(int err)
00205 {
00206     PRErrorCode prError;
00207     switch (err) {
00208     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00209     default:         nss_MD_unix_map_default_error(err); return;
00210     }
00211     PR_SetError(prError, err);
00212 }
00213 
00214 void nss_MD_unix_map_socket_error(int err)
00215 {
00216     PRErrorCode prError;
00217     switch (err) {
00218     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00219     default:         nss_MD_unix_map_default_error(err); return;
00220     }
00221     PR_SetError(prError, err);
00222 }
00223 
00224 void nss_MD_unix_map_socketavailable_error(int err)
00225 {
00226     PR_SetError(PR_BAD_DESCRIPTOR_ERROR, err);
00227 }
00228 
00229 void nss_MD_unix_map_recv_error(int err)
00230 {
00231     nss_MD_unix_map_default_error(err);
00232 }
00233 
00234 void nss_MD_unix_map_recvfrom_error(int err)
00235 {
00236     nss_MD_unix_map_default_error(err);
00237 }
00238 
00239 void nss_MD_unix_map_send_error(int err)
00240 {
00241     nss_MD_unix_map_default_error(err);
00242 }
00243 
00244 void nss_MD_unix_map_sendto_error(int err)
00245 {
00246     nss_MD_unix_map_default_error(err);
00247 }
00248 
00249 void nss_MD_unix_map_writev_error(int err)
00250 {
00251     nss_MD_unix_map_default_error(err);
00252 }
00253 
00254 void nss_MD_unix_map_accept_error(int err)
00255 {
00256     PRErrorCode prError;
00257     switch (err) {
00258     case ENODEV:     prError = PR_NOT_TCP_SOCKET_ERROR; break;
00259     default:         nss_MD_unix_map_default_error(err); return;
00260     }
00261     PR_SetError(prError, err);
00262 }
00263 
00264 void nss_MD_unix_map_connect_error(int err)
00265 {
00266     PRErrorCode prError;
00267     switch (err) {
00268     case EACCES:     prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00269 #if defined(UNIXWARE) || defined(SNI) || defined(NEC)
00270     /*
00271      * On some platforms, if we connect to a port on the local host 
00272      * (the loopback address) that no process is listening on, we get 
00273      * EIO instead of ECONNREFUSED.
00274      */
00275     case EIO:        prError = PR_CONNECT_REFUSED_ERROR; break;
00276 #endif
00277     case ELOOP:             prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00278     case ENOENT:     prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00279     case ENXIO:             prError = PR_IO_ERROR; break;
00280     default:         nss_MD_unix_map_default_error(err); return;
00281     }
00282     PR_SetError(prError, err);
00283 }
00284 
00285 void nss_MD_unix_map_bind_error(int err)
00286 {
00287     PRErrorCode prError;
00288     switch (err) {
00289     case EINVAL:     prError = PR_SOCKET_ADDRESS_IS_BOUND_ERROR; break;
00290         /*
00291          * UNIX domain sockets are not supported in NSPR
00292          */
00293     case EIO:        prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00294     case EISDIR:     prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00295     case ELOOP:             prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00296     case ENOENT:     prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00297     case ENOTDIR:    prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00298     case EROFS:             prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00299     default:         nss_MD_unix_map_default_error(err); return;
00300     }
00301     PR_SetError(prError, err);
00302 }
00303 
00304 void nss_MD_unix_map_listen_error(int err)
00305 {
00306     nss_MD_unix_map_default_error(err);
00307 }
00308 
00309 void nss_MD_unix_map_shutdown_error(int err)
00310 {
00311     nss_MD_unix_map_default_error(err);
00312 }
00313 
00314 void nss_MD_unix_map_socketpair_error(int err)
00315 {
00316     PRErrorCode prError;
00317     switch (err) {
00318     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00319     default:         nss_MD_unix_map_default_error(err); return;
00320     }
00321     PR_SetError(prError, err);
00322 }
00323 
00324 void nss_MD_unix_map_getsockname_error(int err)
00325 {
00326     PRErrorCode prError;
00327     switch (err) {
00328     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00329     default:         nss_MD_unix_map_default_error(err); return;
00330     }
00331     PR_SetError(prError, err);
00332 }
00333 
00334 void nss_MD_unix_map_getpeername_error(int err)
00335 {
00336     PRErrorCode prError;
00337 
00338     switch (err) {
00339     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00340     default:         nss_MD_unix_map_default_error(err); return;
00341     }
00342     PR_SetError(prError, err);
00343 }
00344 
00345 void nss_MD_unix_map_getsockopt_error(int err)
00346 {
00347     PRErrorCode prError;
00348     switch (err) {
00349     case EINVAL:     prError = PR_BUFFER_OVERFLOW_ERROR; break;
00350     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00351     default:         nss_MD_unix_map_default_error(err); return;
00352     }
00353     PR_SetError(prError, err);
00354 }
00355 
00356 void nss_MD_unix_map_setsockopt_error(int err)
00357 {
00358     PRErrorCode prError;
00359     switch (err) {
00360     case EINVAL:     prError = PR_BUFFER_OVERFLOW_ERROR; break;
00361     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00362     default:         nss_MD_unix_map_default_error(err); return;
00363     }
00364     PR_SetError(prError, err);
00365 }
00366 
00367 void nss_MD_unix_map_open_error(int err)
00368 {
00369     PRErrorCode prError;
00370     switch (err) {
00371     case EAGAIN:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00372     case EBUSY:             prError = PR_IO_ERROR; break;
00373     case ENODEV:     prError = PR_FILE_NOT_FOUND_ERROR; break;
00374     case ENOMEM:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00375     case ETIMEDOUT:  prError = PR_REMOTE_FILE_ERROR; break;
00376     default:         nss_MD_unix_map_default_error(err); return;
00377     }
00378     PR_SetError(prError, err);
00379 }
00380 
00381 void nss_MD_unix_map_mmap_error(int err)
00382 {
00383     PRErrorCode prError;
00384     switch (err) {
00385     case EAGAIN:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00386     case EMFILE:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00387     case ENODEV:     prError = PR_OPERATION_NOT_SUPPORTED_ERROR; break;
00388     case ENXIO:             prError = PR_INVALID_ARGUMENT_ERROR; break;
00389     default:         nss_MD_unix_map_default_error(err); return;
00390     }
00391     PR_SetError(prError, err);
00392 }
00393 
00394 void nss_MD_unix_map_gethostname_error(int err)
00395 {
00396     nss_MD_unix_map_default_error(err);
00397 }
00398 
00399 void nss_MD_unix_map_select_error(int err)
00400 {
00401     nss_MD_unix_map_default_error(err);
00402 }
00403 
00404 #ifdef _PR_POLL_AVAILABLE
00405 void nss_MD_unix_map_poll_error(int err)
00406 {
00407     PRErrorCode prError;
00408 
00409     switch (err) {
00410     case EAGAIN:     prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00411     default:         nss_MD_unix_map_default_error(err); return;
00412     }
00413     PR_SetError(prError, err);
00414 }
00415 
00416 void nss_MD_unix_map_poll_revents_error(int err)
00417 {
00418     if (err & POLLNVAL)
00419         PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF);
00420     else if (err & POLLHUP)
00421         PR_SetError(PR_CONNECT_RESET_ERROR, EPIPE);
00422     else if (err & POLLERR)
00423         PR_SetError(PR_IO_ERROR, EIO);
00424     else
00425         PR_SetError(PR_UNKNOWN_ERROR, err);
00426 }
00427 #endif /* _PR_POLL_AVAILABLE */
00428 
00429 
00430 void nss_MD_unix_map_flock_error(int err)
00431 {
00432     PRErrorCode prError;
00433     switch (err) {
00434     case EINVAL:     prError = PR_BAD_DESCRIPTOR_ERROR; break;
00435     case EWOULDBLOCK:       prError = PR_FILE_IS_LOCKED_ERROR; break;
00436     default:         nss_MD_unix_map_default_error(err); return;
00437     }
00438     PR_SetError(prError, err);
00439 }
00440 
00441 void nss_MD_unix_map_lockf_error(int err)
00442 {
00443     PRErrorCode prError;
00444     switch (err) {
00445     case EACCES:     prError = PR_FILE_IS_LOCKED_ERROR; break;
00446     case EDEADLK:    prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00447     default:         nss_MD_unix_map_default_error(err); return;
00448     }
00449     PR_SetError(prError, err);
00450 }
00451 
00452 #ifdef HPUX11
00453 void nss_MD_hpux_map_sendfile_error(int err)
00454 {
00455     nss_MD_unix_map_default_error(err);
00456 }
00457 #endif /* HPUX11 */
00458 
00459 
00460 void nss_MD_unix_map_default_error(int err)
00461 {
00462     PRErrorCode prError;
00463     switch (err ) {
00464     case EACCES:     prError = PR_NO_ACCESS_RIGHTS_ERROR; break;
00465     case EADDRINUSE: prError = PR_ADDRESS_IN_USE_ERROR; break;
00466     case EADDRNOTAVAIL:     prError = PR_ADDRESS_NOT_AVAILABLE_ERROR; break;
00467     case EAFNOSUPPORT:      prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00468     case EAGAIN:     prError = PR_WOULD_BLOCK_ERROR; break;
00469     /*
00470      * On QNX and Neutrino, EALREADY is defined as EBUSY.
00471      */
00472 #if EALREADY != EBUSY
00473     case EALREADY:   prError = PR_ALREADY_INITIATED_ERROR; break;
00474 #endif
00475     case EBADF:             prError = PR_BAD_DESCRIPTOR_ERROR; break;
00476 #ifdef EBADMSG
00477     case EBADMSG:    prError = PR_IO_ERROR; break;
00478 #endif
00479     case EBUSY:             prError = PR_FILESYSTEM_MOUNTED_ERROR; break;
00480     case ECONNREFUSED:      prError = PR_CONNECT_REFUSED_ERROR; break;
00481     case ECONNRESET: prError = PR_CONNECT_RESET_ERROR; break;
00482     case EDEADLK:    prError = PR_DEADLOCK_ERROR; break;
00483 #ifdef EDIRCORRUPTED
00484     case EDIRCORRUPTED:     prError = PR_DIRECTORY_CORRUPTED_ERROR; break;
00485 #endif
00486 #ifdef EDQUOT
00487     case EDQUOT:     prError = PR_NO_DEVICE_SPACE_ERROR; break;
00488 #endif
00489     case EEXIST:     prError = PR_FILE_EXISTS_ERROR; break;
00490     case EFAULT:     prError = PR_ACCESS_FAULT_ERROR; break;
00491     case EFBIG:             prError = PR_FILE_TOO_BIG_ERROR; break;
00492     case EINPROGRESS:       prError = PR_IN_PROGRESS_ERROR; break;
00493     case EINTR:             prError = PR_PENDING_INTERRUPT_ERROR; break;
00494     case EINVAL:     prError = PR_INVALID_ARGUMENT_ERROR; break;
00495     case EIO:        prError = PR_IO_ERROR; break;
00496     case EISCONN:    prError = PR_IS_CONNECTED_ERROR; break;
00497     case EISDIR:     prError = PR_IS_DIRECTORY_ERROR; break;
00498     case ELOOP:             prError = PR_LOOP_ERROR; break;
00499     case EMFILE:     prError = PR_PROC_DESC_TABLE_FULL_ERROR; break;
00500     case EMLINK:     prError = PR_MAX_DIRECTORY_ENTRIES_ERROR; break;
00501     case EMSGSIZE:   prError = PR_INVALID_ARGUMENT_ERROR; break;
00502 #ifdef EMULTIHOP
00503     case EMULTIHOP:  prError = PR_REMOTE_FILE_ERROR; break;
00504 #endif
00505     case ENAMETOOLONG:      prError = PR_NAME_TOO_LONG_ERROR; break;
00506     case ENETUNREACH:       prError = PR_NETWORK_UNREACHABLE_ERROR; break;
00507     case ENFILE:     prError = PR_SYS_DESC_TABLE_FULL_ERROR; break;
00508 #if !defined(SCO)
00509     case ENOBUFS:    prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00510 #endif
00511     case ENODEV:     prError = PR_FILE_NOT_FOUND_ERROR; break;
00512     case ENOENT:     prError = PR_FILE_NOT_FOUND_ERROR; break;
00513     case ENOLCK:     prError = PR_FILE_IS_LOCKED_ERROR; break;
00514 #ifdef ENOLINK 
00515     case ENOLINK:    prError = PR_REMOTE_FILE_ERROR; break;
00516 #endif
00517     case ENOMEM:     prError = PR_OUT_OF_MEMORY_ERROR; break;
00518     case ENOPROTOOPT:       prError = PR_INVALID_ARGUMENT_ERROR; break;
00519     case ENOSPC:     prError = PR_NO_DEVICE_SPACE_ERROR; break;
00520 #ifdef ENOSR 
00521     case ENOSR:             prError = PR_INSUFFICIENT_RESOURCES_ERROR; break;
00522 #endif
00523     case ENOTCONN:   prError = PR_NOT_CONNECTED_ERROR; break;
00524     case ENOTDIR:    prError = PR_NOT_DIRECTORY_ERROR; break;
00525     case ENOTSOCK:   prError = PR_NOT_SOCKET_ERROR; break;
00526     case ENXIO:             prError = PR_FILE_NOT_FOUND_ERROR; break;
00527     case EOPNOTSUPP: prError = PR_NOT_TCP_SOCKET_ERROR; break;
00528 #ifdef EOVERFLOW
00529     case EOVERFLOW:  prError = PR_BUFFER_OVERFLOW_ERROR; break;
00530 #endif
00531     case EPERM:             prError = PR_NO_ACCESS_RIGHTS_ERROR; break;
00532     case EPIPE:             prError = PR_CONNECT_RESET_ERROR; break;
00533 #ifdef EPROTO
00534     case EPROTO:     prError = PR_IO_ERROR; break;
00535 #endif
00536     case EPROTONOSUPPORT: prError = PR_PROTOCOL_NOT_SUPPORTED_ERROR; break;
00537     case EPROTOTYPE: prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break;
00538     case ERANGE:     prError = PR_INVALID_METHOD_ERROR; break;
00539     case EROFS:             prError = PR_READ_ONLY_FILESYSTEM_ERROR; break;
00540     case ESPIPE:     prError = PR_INVALID_METHOD_ERROR; break;
00541     case ETIMEDOUT:  prError = PR_IO_TIMEOUT_ERROR; break;
00542 #if EWOULDBLOCK != EAGAIN
00543     case EWOULDBLOCK:       prError = PR_WOULD_BLOCK_ERROR; break;
00544 #endif
00545     case EXDEV:             prError = PR_NOT_SAME_DEVICE_ERROR; break;
00546 
00547     default:         prError = PR_UNKNOWN_ERROR; break;
00548     }
00549     PR_SetError(prError, err);
00550 }