提交 8d8effee authored 作者: Michael Jerris's avatar Michael Jerris

starting to slim down the nspr build in prep to merge with the libjs build.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4910 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 77121a31
......@@ -259,8 +259,8 @@ void _PR_InitFdCache(void)
** be overridden at runtime using environment variables
** or a super-wiz-bang API.
*/
const char *low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW");
const char *high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH");
//const char *low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW");
//const char *high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH");
/*
** _low is allowed to be zero, _high is not.
......@@ -274,8 +274,8 @@ void _PR_InitFdCache(void)
_pr_fd_cache.limit_high = 0;
#endif /* defined(DEBUG) */
if (NULL != low) _pr_fd_cache.limit_low = atoi(low);
if (NULL != high) _pr_fd_cache.limit_high = atoi(high);
//if (NULL != low) _pr_fd_cache.limit_low = atoi(low);
//if (NULL != high) _pr_fd_cache.limit_high = atoi(high);
if (_pr_fd_cache.limit_high < _pr_fd_cache.limit_low)
_pr_fd_cache.limit_high = _pr_fd_cache.limit_low;
......
......@@ -204,11 +204,11 @@ PRIntn strcasecmp(const char *a, const char *b)
void _PR_InitLog(void)
{
char *ev;
char *ev = NULL;
_pr_logLock = PR_NewLock();
ev = PR_GetEnv("NSPR_LOG_MODULES");
// ev = PR_GetEnv("NSPR_LOG_MODULES");
if (ev && ev[0]) {
char module[64]; /* Security-Critical: If you change this
* size, you must also change the sscanf
......@@ -255,7 +255,7 @@ void _PR_InitLog(void)
}
PR_SetLogBuffering(isSync ? bufSize : 0);
ev = PR_GetEnv("NSPR_LOG_FILE");
//ev = PR_GetEnv("NSPR_LOG_FILE");
if (ev && ev[0]) {
if (!PR_SetLogFile(ev)) {
#ifdef XP_PC
......@@ -316,9 +316,9 @@ void _PR_LogCleanup(void)
static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm )
{
char *ev;
char *ev = NULL;
ev = PR_GetEnv("NSPR_LOG_MODULES");
//ev = PR_GetEnv("NSPR_LOG_MODULES");
if (ev && ev[0]) {
char module[64]; /* Security-Critical: If you change this
* size, you must also change the sscanf
......
......@@ -202,7 +202,7 @@ static void _PR_InitStuff(void)
_PR_InitSegs();
_PR_InitStacks();
_PR_InitTPD();
_PR_InitEnv();
//_PR_InitEnv();
_PR_InitLayerCache();
_PR_InitClock();
......@@ -234,20 +234,20 @@ static void _PR_InitStuff(void)
_PR_InitMem();
#endif
_PR_InitCMon();
//_PR_InitCMon();
_PR_InitIO();
_PR_InitNet();
//_PR_InitNet();
_PR_InitLog();
_PR_InitLinker();
//_PR_InitLinker();
_PR_InitCallOnce();
_PR_InitDtoa();
//_PR_InitDtoa();
_PR_InitMW();
_PR_InitRWLocks();
//_PR_InitRWLocks();
nspr_InitializePRErrorTable();
//nspr_InitializePRErrorTable();
#if !defined(_PR_INET6) || defined(_PR_INET6_PROBE)
_pr_init_ipv6();
//_pr_init_ipv6();
#endif
_PR_MD_FINAL_INIT();
......@@ -420,9 +420,9 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
#endif
_PR_CleanupMW();
_PR_CleanupDtoa();
//_PR_CleanupDtoa();
_PR_CleanupCallOnce();
_PR_ShutdownLinker();
//_PR_ShutdownLinker();
/* Release the primordial thread's private data, etc. */
_PR_CleanupThread(me);
......@@ -452,7 +452,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
* Ideally, for each _PR_InitXXX(), there should be a corresponding
* _PR_XXXCleanup() that we can call here.
*/
_PR_CleanupNet();
//_PR_CleanupNet();
_PR_CleanupIO();
#ifdef WINNT
_PR_CleanupCPUs();
......@@ -461,7 +461,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
PR_DestroyLock(_pr_sleeplock);
_pr_sleeplock = NULL;
_PR_CleanupLayerCache();
_PR_CleanupEnv();
//_PR_CleanupEnv();
_PR_CleanupStacks();
_PR_CleanupBeforeExit();
_pr_initialized = PR_FALSE;
......@@ -543,25 +543,6 @@ PR_ProcessAttrSetStdioRedirect(
}
}
/*
* OBSOLETE
*/
PR_IMPLEMENT(void)
PR_SetStdioRedirect(
PRProcessAttr *attr,
PRSpecialFD stdioFd,
PRFileDesc *redirectFd)
{
#if defined(DEBUG)
static PRBool warn = PR_TRUE;
if (warn) {
warn = _PR_Obsolete("PR_SetStdioRedirect()",
"PR_ProcessAttrSetStdioRedirect()");
}
#endif
PR_ProcessAttrSetStdioRedirect(attr, stdioFd, redirectFd);
}
PR_IMPLEMENT(PRStatus)
PR_ProcessAttrSetCurrentDirectory(
PRProcessAttr *attr,
......@@ -659,75 +640,6 @@ PR_ProcessAttrSetInheritableFD(
return PR_SUCCESS;
}
PR_IMPLEMENT(PRFileDesc *) PR_GetInheritedFD(
const char *name)
{
PRFileDesc *fd;
const char *envVar;
const char *ptr;
int len = strlen(name);
PROsfd osfd;
int nColons;
PRIntn fileType;
envVar = PR_GetEnv("NSPR_INHERIT_FDS");
if (NULL == envVar || '\0' == envVar[0]) {
PR_SetError(PR_UNKNOWN_ERROR, 0);
return NULL;
}
ptr = envVar;
while (1) {
if ((ptr[len] == ':') && (strncmp(ptr, name, len) == 0)) {
ptr += len + 1;
PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd);
switch ((PRDescType)fileType) {
case PR_DESC_FILE:
fd = PR_ImportFile(osfd);
break;
case PR_DESC_PIPE:
fd = PR_ImportPipe(osfd);
break;
case PR_DESC_SOCKET_TCP:
fd = PR_ImportTCPSocket(osfd);
break;
case PR_DESC_SOCKET_UDP:
fd = PR_ImportUDPSocket(osfd);
break;
default:
PR_ASSERT(0);
PR_SetError(PR_UNKNOWN_ERROR, 0);
fd = NULL;
break;
}
if (fd) {
/*
* An inherited FD is inheritable by default.
* The child process needs to call PR_SetFDInheritable
* to make it non-inheritable if so desired.
*/
fd->secret->inheritable = _PR_TRI_TRUE;
}
return fd;
}
/* Skip three colons */
nColons = 0;
while (*ptr) {
if (*ptr == ':') {
if (++nColons == 3) {
break;
}
}
ptr++;
}
if (*ptr == '\0') {
PR_SetError(PR_UNKNOWN_ERROR, 0);
return NULL;
}
ptr++;
}
}
PR_IMPLEMENT(PRProcess*) PR_CreateProcess(
const char *path,
char *const *argv,
......@@ -851,20 +763,6 @@ PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg(
return once->status;
}
PRBool _PR_Obsolete(const char *obsolete, const char *preferred)
{
#if defined(DEBUG)
#ifndef XP_MAC
PR_fprintf(
PR_STDERR, "'%s' is obsolete. Use '%s' instead.\n",
obsolete, (NULL == preferred) ? "something else" : preferred);
#else
#pragma unused (obsolete, preferred)
#endif
#endif
return PR_FALSE;
} /* _PR_Obsolete */
/* prinit.c */
......@@ -73,14 +73,6 @@ void _PR_CleanupThread(PRThread *thread)
thread->environment = NULL;
}
PR_IMPLEMENT(PRStatus) PR_Yield()
{
static PRBool warning = PR_TRUE;
if (warning) warning = _PR_Obsolete(
"PR_Yield()", "PR_Sleep(PR_INTERVAL_NO_WAIT)");
return (PR_Sleep(PR_INTERVAL_NO_WAIT));
}
/*
** Make the current thread sleep until "timeout" ticks amount of time
** has expired. If "timeout" is PR_INTERVAL_NO_WAIT then the call is
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论