comparison nspr/lib/libc/src/plerror.c @ 0:1e5118fa0cb1

This is NSS with a Cmake Buildsyste To compile a static NSS library for Windows we've used the Chromium-NSS fork and added a Cmake buildsystem to compile it statically for Windows. See README.chromium for chromium changes and README.trustbridge for our modifications.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 28 Jul 2014 10:47:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e5118fa0cb1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 /*
7 ** File:plerror.c
8 ** Description: Simple routine to print translate the calling thread's
9 ** error numbers and print them to "syserr".
10 */
11
12 #include "plerror.h"
13
14 #include "prprf.h"
15 #include "prerror.h"
16
17 PR_IMPLEMENT(void) PL_FPrintError(PRFileDesc *fd, const char *msg)
18 {
19 PRErrorCode error = PR_GetError();
20 PRInt32 oserror = PR_GetOSError();
21 const char *name = PR_ErrorToName(error);
22
23 if (NULL != msg) PR_fprintf(fd, "%s: ", msg);
24 if (NULL == name)
25 PR_fprintf(
26 fd, " (%d)OUT OF RANGE, oserror = %d\n", error, oserror);
27 else
28 PR_fprintf(
29 fd, "%s(%d), oserror = %d\n",
30 name, error, oserror);
31 } /* PL_FPrintError */
32
33 PR_IMPLEMENT(void) PL_PrintError(const char *msg)
34 {
35 static PRFileDesc *fd = NULL;
36 if (NULL == fd) fd = PR_GetSpecialFD(PR_StandardError);
37 PL_FPrintError(fd, msg);
38 } /* PL_PrintError */
39
40 /* plerror.c */
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)