diff options
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/conditn.cxx | 38 | ||||
-rw-r--r-- | sal/osl/unx/process.cxx | 118 | ||||
-rw-r--r-- | sal/osl/w32/security.c | 31 |
3 files changed, 41 insertions, 146 deletions
diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx index c6417bfb2f7a..c3fe130293e8 100644 --- a/sal/osl/unx/conditn.cxx +++ b/sal/osl/unx/conditn.cxx @@ -58,7 +58,7 @@ oslCondition SAL_CALL osl_createCondition() if ( pCond == 0 ) { - SAL_WARN("sal", "std::bad_alloc in C"); + SAL_WARN("sal.osl", "std::bad_alloc in C"); return 0; } @@ -69,7 +69,7 @@ oslCondition SAL_CALL osl_createCondition() if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_cond_init failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -81,13 +81,13 @@ oslCondition SAL_CALL osl_createCondition() if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_mutex_init failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); nRet = pthread_cond_destroy(&pCond->m_Condition); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_cond_destroy failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -112,12 +112,12 @@ void SAL_CALL osl_destroyCondition(oslCondition Condition) nRet = pthread_cond_destroy(&pCond->m_Condition); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_cond_destroy failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); nRet = pthread_mutex_destroy(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_destroy failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -147,7 +147,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition) if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); return sal_False; @@ -158,7 +158,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition) if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_cond_broadcast failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); return sal_False; @@ -168,7 +168,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition) if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); return sal_False; @@ -199,7 +199,7 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition) if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); return sal_False; @@ -211,7 +211,7 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition) if ( nRet != 0 ) { SAL_WARN( - "sal", "pthread_mutex_unlock failed, errno " << nRet <<", \"" + "sal.osl", "pthread_mutex_unlock failed, errno " << nRet <<", \"" << strerror(nRet) << '"'); return sal_False; } @@ -240,7 +240,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time if ( nRet != 0 ) { SAL_WARN( - "sal", "pthread_mutex_lock failed, errno " << nRet <<", \"" + "sal.osl", "pthread_mutex_lock failed, errno " << nRet <<", \"" << strerror(nRet) << '"'); return osl_cond_result_error; } @@ -269,7 +269,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time Result = osl_cond_result_timeout; nRet = pthread_mutex_unlock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -280,7 +280,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time Result = osl_cond_result_error; nRet = pthread_mutex_unlock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); return Result; @@ -298,13 +298,13 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time if ( nRet != 0 ) { SAL_WARN( - "sal", + "sal.osl", "pthread_cond_wait failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); Result = osl_cond_result_error; nRet = pthread_mutex_unlock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -315,7 +315,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time nRet = pthread_mutex_unlock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -341,7 +341,7 @@ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition) nRet = pthread_mutex_lock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); @@ -349,7 +349,7 @@ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition) nRet = pthread_mutex_unlock(&pCond->m_Lock); SAL_WARN_IF( - nRet != 0, "sal", + nRet != 0, "sal.osl", "pthread_mutex_unlock failed, errno " << nRet << ", \"" << strerror(nRet) << '"'); diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index eb1fdf4a98f2..3bf0c98e6e7d 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -75,19 +75,11 @@ #define MAX_ARGS 255 #define MAX_ENVS 255 -/****************************************************************************** - * - * Data Type Definition - * - ******************************************************************************/ - -typedef struct { - int m_hPipe; - int m_hConn; - sal_Char m_Name[PATH_MAX + 1]; -} Pipe; +namespace +{ -typedef struct { +struct ProcessData +{ const sal_Char* m_pszArgs[MAX_ARGS + 1]; oslProcessOption m_options; const sal_Char* m_pszDir; @@ -100,27 +92,7 @@ typedef struct { oslFileHandle *m_pInputWrite; oslFileHandle *m_pOutputRead; oslFileHandle *m_pErrorRead; -} ProcessData; - -/****************************************************************************** - * - * Function Declarations - * - *****************************************************************************/ - -oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, - sal_Char *pszArguments[], - oslProcessOption Options, - oslSecurity Security, - sal_Char *pszDirectory, - sal_Char *pszEnvironments[], - oslProcess *pProcess, - oslFileHandle *pInputWrite, - oslFileHandle *pOutputRead, - oslFileHandle *pErrorRead ); - - -sal_Bool osl_getFullPath(const sal_Char* pszFilename, sal_Char* pszPath, sal_uInt32 MaxLen); +}; static oslProcessImpl* ChildList; static oslMutex ChildListMutex; @@ -185,6 +157,19 @@ static oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, return osl_Process_E_NotFound; } +} //Anonymous namespace + +oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, + sal_Char *pszArguments[], + oslProcessOption Options, + oslSecurity Security, + sal_Char *pszDirectory, + sal_Char *pszEnvironments[], + oslProcess *pProcess, + oslFileHandle *pInputWrite, + oslFileHandle *pOutputRead, + oslFileHandle *pErrorRead ); + /****************************************************************************** * * New io resource transfer functions @@ -192,19 +177,11 @@ static oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, *****************************************************************************/ -/********************************************** - osl_sendResourcePipe - *********************************************/ - sal_Bool osl_sendResourcePipe(oslPipe /*pPipe*/, oslSocket /*pSocket*/) { return osl_Process_E_InvalidError; } -/********************************************** - osl_receiveResourcePipe - *********************************************/ - oslSocket osl_receiveResourcePipe(oslPipe /*pPipe*/) { oslSocket pSocket = 0; @@ -243,7 +220,7 @@ static void ChildStatusProc(void *pData) if (socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == -1) { status = errno; - SAL_WARN("sal", "executeProcess socketpair() errno " << status); + SAL_WARN("sal.osl", "executeProcess socketpair() errno " << status); } fcntl(channel[0], F_SETFD, FD_CLOEXEC); @@ -254,21 +231,21 @@ static void ChildStatusProc(void *pData) { status = errno; assert(status != 0); - SAL_WARN("sal", "executeProcess pipe(stdInput) errno " << status); + SAL_WARN("sal.osl", "executeProcess pipe(stdInput) errno " << status); } if ( status == 0 && data.m_pOutputRead && pipe( stdOutput ) == -1 ) { status = errno; assert(status != 0); - SAL_WARN("sal", "executeProcess pipe(stdOutput) errno " << status); + SAL_WARN("sal.osl", "executeProcess pipe(stdOutput) errno " << status); } if ( status == 0 && data.m_pErrorRead && pipe( stdError ) == -1 ) { status = errno; assert(status != 0); - SAL_WARN("sal", "executeProcess pipe(stdError) errno " << status); + SAL_WARN("sal.osl", "executeProcess pipe(stdError) errno " << status); } if ( (status == 0) && ((pid = fork()) == 0) ) @@ -490,10 +467,6 @@ static void ChildStatusProc(void *pData) } -/********************************************** - osl_executeProcess_WithRedirectedIO - *********************************************/ - oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO( rtl_uString *ustrImageName, rtl_uString *ustrArguments[], @@ -612,10 +585,6 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO( return Error; } -/********************************************** - osl_executeProcess - *********************************************/ - oslProcessError SAL_CALL osl_executeProcess( rtl_uString *ustrImageName, rtl_uString *ustrArguments[], @@ -644,10 +613,6 @@ oslProcessError SAL_CALL osl_executeProcess( ); } -/********************************************** - osl_psz_executeProcess - *********************************************/ - oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, sal_Char *pszArguments[], oslProcessOption Options, @@ -761,7 +726,6 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, return osl_Process_E_Unknown; } - /****************************************************************************** * * Functions for processes @@ -769,10 +733,6 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, *****************************************************************************/ -/********************************************** - osl_terminateProcess - *********************************************/ - oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) { if (Process == NULL) @@ -796,10 +756,6 @@ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) return osl_Process_E_None; } -/********************************************** - osl_getProcess - *********************************************/ - oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident) { oslProcessImpl *pProcImpl; @@ -850,10 +806,6 @@ oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident) return (pProcImpl); } -/********************************************** - osl_freeProcessHandle - *********************************************/ - void SAL_CALL osl_freeProcessHandle(oslProcess Process) { if (Process != NULL) @@ -931,17 +883,10 @@ struct osl_procStat unsigned long kstkesp; /* current value of 'esp' (stack pointer) */ unsigned long kstkeip; /* current value of 'eip' (instruction pointer) */ /* mfe: Linux > 2.1.7x have more signals (88) */ -/*#ifdef LINUX */ char signal[24]; /* pending signals */ char blocked[24]; /* blocked signals */ char sigignore[24]; /* ignored signals */ char sigcatch[24]; /* catched signals */ -/*#else*/ -/* long long signal;*/ -/* long long blocked;*/ -/* long long sigignore;*/ -/* long long sigcatch;*/ -/*#endif */ unsigned long wchan; /* 'channel' the process is waiting in */ unsigned long nswap; /* ? */ unsigned long cnswap; /* ? */ @@ -964,10 +909,6 @@ struct osl_procStat unsigned long vm_lib; /* library size */ }; -/********************************************** - osl_getProcStat - *********************************************/ - sal_Bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) { int fd = 0; @@ -983,7 +924,6 @@ sal_Bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) bRet = safeRead(fd, prstatbuf, 511); close(fd); - /*printf("%s\n\n",prstatbuf);*/ if (!bRet) return sal_False; @@ -1017,10 +957,6 @@ sal_Bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) return bRet; } -/********************************************** - osl_getProcStatus - *********************************************/ - sal_Bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) { int fd = 0; @@ -1038,8 +974,6 @@ sal_Bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) close(fd); - /* printf("\n\n%s\n\n",prstatusbuf);*/ - if (!bRet) return sal_False; @@ -1089,10 +1023,6 @@ sal_Bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) #endif -/********************************************** - osl_getProcessInfo - *********************************************/ - oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData Fields, oslProcessInfo* pInfo) { pid_t pid; @@ -1314,10 +1244,6 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti return osl_error; } -/********************************************** - osl_joinProcess - *********************************************/ - oslProcessError SAL_CALL osl_joinProcess(oslProcess Process) { return osl_joinProcessWithTimeout(Process, NULL); diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c index 82fd8335e4c4..a05614b65e90 100644 --- a/sal/osl/w32/security.c +++ b/sal/osl/w32/security.c @@ -464,37 +464,6 @@ sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirect } else { -#if 0 - if (pSecImpl->m_hToken) - { - DWORD nInfoBuffer = 512; - UCHAR* pInfoBuffer = malloc(nInfoBuffer); - - while (!GetTokenInformation(pSecImpl->m_hToken, TokenUser, - pInfoBuffer, nInfoBuffer, &nInfoBuffer)) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - pInfoBuffer = realloc(pInfoBuffer, nInfoBuffer); - else - { - free(pInfoBuffer); - pInfoBuffer = NULL; - break; - } - } - - /* not implemented */ - OSL_ASSERT(sal_False); - - if (pInfoBuffer) - { - /* if (EqualSid() ... */ - - } - } - else -#endif - bSuccess = (sal_Bool)(GetSpecialFolder(&ustrSysDir, CSIDL_PERSONAL) && (osl_File_E_None == osl_getFileURLFromSystemPath(ustrSysDir, pustrDirectory))); } |