summaryrefslogtreecommitdiff
path: root/sal/osl/unx/process.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-01 13:02:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-06 05:38:14 +0000
commit2e293a731c1559c9869dfcb32491bc600fc18e4e (patch)
treedc43bd0d4ce9b55c3f4a6ae99abd830b395fcd9e /sal/osl/unx/process.cxx
parentcc719ad619f1897d05581e38a2703add6f6a1050 (diff)
new loplugin/rewriter comparisonwithconstant
As per sberg' suggestion Limit it to == and !=, because some people like the flow of inequalities like: "0 < a && a < 42" The changes to sal/ were made using the rewriter. The rewriter still has one bug, in pipe.cxx, it managed to pick up some random piece of macro. No idea why. Change-Id: I01305f9c5396a4b6c7421d6e92f1b4b529388e82 Reviewed-on: https://gerrit.libreoffice.org/30962 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx/process.cxx')
-rw-r--r--sal/osl/unx/process.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index 9a9ba28c9e08..5f4182d096f2 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -1136,7 +1136,7 @@ static bool is_timeout(const struct timeval* tend)
static bool is_process_dead(pid_t pid)
{
- return ((-1 == kill(pid, 0)) && (ESRCH == errno));
+ return ((kill(pid, 0) == -1) && (ESRCH == errno));
}
/**********************************************
@@ -1171,9 +1171,9 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti
{
oslConditionResult cond_res = osl_waitCondition(pChild->m_terminated, pTimeout);
- if (osl_cond_result_timeout == cond_res)
+ if (cond_res == osl_cond_result_timeout)
osl_error = osl_Process_E_TimedOut;
- else if (osl_cond_result_ok != cond_res)
+ else if (cond_res != osl_cond_result_ok)
osl_error = osl_Process_E_Unknown;
}
else /* alien process; StatusThread will not be able