summaryrefslogtreecommitdiff
path: root/src/utils/process.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/utils/process.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/utils/process.cpp')
-rw-r--r--src/utils/process.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/process.cpp b/src/utils/process.cpp
index f84506024..6431c22d5 100644
--- a/src/utils/process.cpp
+++ b/src/utils/process.cpp
@@ -117,21 +117,21 @@ int execFileWait(const std::string &pathName, const std::string &name,
pid_t mon_pid;
int status;
- if (!waitTime)
+ if (waitTime == 0)
waitTime = timeOut;
if ((mon_pid = fork()) == -1)
{ // fork error
return -1;
}
- else if (!mon_pid)
+ else if (mon_pid == 0)
{ // monitoring child
pid_t pid;
if ((pid = fork()) == -1)
{ // fork error
return -1;
}
- else if (!pid)
+ else if (pid == 0)
{ // work child
if (arg2.empty())
{
@@ -152,7 +152,7 @@ int execFileWait(const std::string &pathName, const std::string &name,
{ // fork error
return -1;
}
- else if (!sleep_pid)
+ else if (sleep_pid == 0)
{ // sleep pid
sleep(waitTime);
execl("/bin/true", "/bin/true", static_cast<char *>(nullptr));
@@ -191,7 +191,7 @@ bool execFile(const std::string &pathName, const std::string &name,
{
struct stat statbuf;
// file not exists
- if (stat(pathName.c_str(), &statbuf))
+ if (stat(pathName.c_str(), &statbuf) != 0)
return false;
pid_t pid;
@@ -199,7 +199,7 @@ bool execFile(const std::string &pathName, const std::string &name,
{ // fork error
return false;
}
- else if (!pid)
+ else if (pid == 0)
{ // work child
if (arg2.empty())
{