diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-07 04:22:16 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-07 04:24:47 +1000 |
commit | d0f3d5eb384d08b5c3a6995dadeacce2203f8f47 (patch) | |
tree | 295e1292d6dd81da3858cdf4178becf1f0796d14 /sal/osl/unx/process.cxx | |
parent | 1d1eb99f7a5ac0c10fb6cb7349e82ca069f432a5 (diff) |
osl: remove comment cruft, whitespace cleanup of process.cxx
Change-Id: I9609306dfe70595e67ee6100ce236e849e7a3eca
Diffstat (limited to 'sal/osl/unx/process.cxx')
-rw-r--r-- | sal/osl/unx/process.cxx | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 52b676ab8827..a9fb2986dc4f 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -108,12 +108,6 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, oslFileHandle *pOutputRead, oslFileHandle *pErrorRead ); -/****************************************************************************** - * - * Functions for starting a process - * - *****************************************************************************/ - extern "C" { static void ChildStatusProc(void *pData) @@ -364,9 +358,9 @@ static void ChildStatusProc(void *pData) if (stdOutput[0] != -1) close( stdOutput[0] ); if (stdError[0] != -1) close( stdError[0] ); - //if pid > 0 then a process was created, even if it later failed - //e.g. bash searching for a command to execute, and we still - //need to clean it up to avoid "defunct" processes + /* if pid > 0 then a process was created, even if it later failed + e.g. bash searching for a command to execute, and we still + need to clean it up to avoid "defunct" processes */ if (pid > 0) { pid_t child_pid; @@ -584,7 +578,7 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, oslFileHandle *pErrorRead ) { - int i; + int i; ProcessData Data; oslThread hThread; @@ -680,12 +674,6 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, return osl_Process_E_Unknown; } -/****************************************************************************** - * - * Functions for processes - * - *****************************************************************************/ - oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) { if (Process == nullptr) @@ -1114,9 +1102,8 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; } -/*********************************************** - helper function for osl_joinProcessWithTimeout - **********************************************/ +/** Helper function for osl_joinProcessWithTimeout + */ static bool is_timeout(const struct timeval* tend) { @@ -1125,22 +1112,16 @@ static bool is_timeout(const struct timeval* tend) return (tcurrent.tv_sec >= tend->tv_sec); } -/********************************************** - kill(pid, 0) is useful for checking if a +/* kill(pid, 0) is useful for checking if a process is still alive, but remember that kill even returns 0 if the process is already - a zombie. - *********************************************/ + a zombie. */ static bool is_process_dead(pid_t pid) { return ((kill(pid, 0) == -1) && (ESRCH == errno)); } -/********************************************** - osl_joinProcessWithTimeout - *********************************************/ - oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout) { oslProcessImpl* pChild = ChildList; |