OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* | 2 /* |
3 * This file essentially replicates NSPR's source for the functions that | 3 * This file essentially replicates NSPR's source for the functions that |
4 * map system-specific error codes to NSPR error codes. We would use | 4 * map system-specific error codes to NSPR error codes. We would use |
5 * NSPR's functions, instead of duplicating them, but they're private. | 5 * NSPR's functions, instead of duplicating them, but they're private. |
6 * As long as SSL's server session cache code must do platform native I/O | 6 * As long as SSL's server session cache code must do platform native I/O |
7 * to accomplish its job, and NSPR's error mapping functions remain private, | 7 * to accomplish its job, and NSPR's error mapping functions remain private, |
8 * this code will continue to need to be replicated. | 8 * this code will continue to need to be replicated. |
9 * | 9 * |
10 * This Source Code Form is subject to the terms of the Mozilla Public | 10 * This Source Code Form is subject to the terms of the Mozilla Public |
11 * License, v. 2.0. If a copy of the MPL was not distributed with this | 11 * License, v. 2.0. If a copy of the MPL was not distributed with this |
12 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 12 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
13 /* $Id: win32err.c,v 1.6 2012/04/25 14:50:12 gerv%gerv.net Exp $ */ | 13 /* $Id$ */ |
14 | 14 |
15 #include "prerror.h" | 15 #include "prerror.h" |
16 #include "prlog.h" | 16 #include "prlog.h" |
17 #include <errno.h> | 17 #include <errno.h> |
18 #include <windows.h> | 18 #include <windows.h> |
19 | 19 |
20 /* | 20 /* |
21 * On Win32, we map three kinds of error codes: | 21 * On Win32, we map three kinds of error codes: |
22 * - GetLastError(): for Win32 functions | 22 * - GetLastError(): for Win32 functions |
23 * - WSAGetLastError(): for Winsock functions | 23 * - WSAGetLastError(): for Winsock functions |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 case WSAEPROTOTYPE: prError = PR_INVALID_ARGUMENT_ERROR; break; | 335 case WSAEPROTOTYPE: prError = PR_INVALID_ARGUMENT_ERROR; break; |
336 case WSAESHUTDOWN: prError = PR_SOCKET_SHUTDOWN_ERROR; break; | 336 case WSAESHUTDOWN: prError = PR_SOCKET_SHUTDOWN_ERROR; break; |
337 case WSAESOCKTNOSUPPORT: prError = PR_INVALID_ARGUMENT_ERROR; break; | 337 case WSAESOCKTNOSUPPORT: prError = PR_INVALID_ARGUMENT_ERROR; break; |
338 case WSAETIMEDOUT: prError = PR_CONNECT_ABORTED_ERROR; break; | 338 case WSAETIMEDOUT: prError = PR_CONNECT_ABORTED_ERROR; break; |
339 case WSAEWOULDBLOCK: prError = PR_WOULD_BLOCK_ERROR; break; | 339 case WSAEWOULDBLOCK: prError = PR_WOULD_BLOCK_ERROR; break; |
340 default: prError = PR_UNKNOWN_ERROR; break; | 340 default: prError = PR_UNKNOWN_ERROR; break; |
341 } | 341 } |
342 PR_SetError(prError, err); | 342 PR_SetError(prError, err); |
343 } | 343 } |
344 | 344 |
OLD | NEW |