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 /* This Source Code Form is subject to the terms of the Mozilla Public | 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 | 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/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #include "primpl.h" | 6 #include "primpl.h" |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 PRLogModuleInfo *_pr_clock_lm; | 10 PRLogModuleInfo *_pr_clock_lm; |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 envVar = PR_GetEnv("NSPR_INHERIT_FDS"); | 635 envVar = PR_GetEnv("NSPR_INHERIT_FDS"); |
636 if (NULL == envVar || '\0' == envVar[0]) { | 636 if (NULL == envVar || '\0' == envVar[0]) { |
637 PR_SetError(PR_UNKNOWN_ERROR, 0); | 637 PR_SetError(PR_UNKNOWN_ERROR, 0); |
638 return NULL; | 638 return NULL; |
639 } | 639 } |
640 | 640 |
641 ptr = envVar; | 641 ptr = envVar; |
642 while (1) { | 642 while (1) { |
643 if ((ptr[len] == ':') && (strncmp(ptr, name, len) == 0)) { | 643 if ((ptr[len] == ':') && (strncmp(ptr, name, len) == 0)) { |
644 ptr += len + 1; | 644 ptr += len + 1; |
645 PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd); | 645 if (PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd) != 2) { |
| 646 PR_SetError(PR_UNKNOWN_ERROR, 0); |
| 647 return NULL; |
| 648 } |
646 switch ((PRDescType)fileType) { | 649 switch ((PRDescType)fileType) { |
647 case PR_DESC_FILE: | 650 case PR_DESC_FILE: |
648 fd = PR_ImportFile(osfd); | 651 fd = PR_ImportFile(osfd); |
649 break; | 652 break; |
650 case PR_DESC_PIPE: | 653 case PR_DESC_PIPE: |
651 fd = PR_ImportPipe(osfd); | 654 fd = PR_ImportPipe(osfd); |
652 break; | 655 break; |
653 case PR_DESC_SOCKET_TCP: | 656 case PR_DESC_SOCKET_TCP: |
654 fd = PR_ImportTCPSocket(osfd); | 657 fd = PR_ImportTCPSocket(osfd); |
655 break; | 658 break; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 PR_fprintf( | 830 PR_fprintf( |
828 PR_STDERR, "'%s' is obsolete. Use '%s' instead.\n", | 831 PR_STDERR, "'%s' is obsolete. Use '%s' instead.\n", |
829 obsolete, (NULL == preferred) ? "something else" : preferred); | 832 obsolete, (NULL == preferred) ? "something else" : preferred); |
830 #endif | 833 #endif |
831 return PR_FALSE; | 834 return PR_FALSE; |
832 } /* _PR_Obsolete */ | 835 } /* _PR_Obsolete */ |
833 | 836 |
834 /* prinit.c */ | 837 /* prinit.c */ |
835 | 838 |
836 | 839 |
OLD | NEW |