From dc851cf32fdd874f07efe1f431bb997df067e997 Mon Sep 17 00:00:00 2001 From: zhangzihao Date: Sat, 6 Feb 2021 15:13:05 +0800 Subject: [PATCH] Replacing exit(0) to _exit(0) to avoid crash down. --- libsearch/index/first-index.cpp | 4 ++-- libsearch/index/inotify-index.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsearch/index/first-index.cpp b/libsearch/index/first-index.cpp index c8897d0..cd82654 100644 --- a/libsearch/index/first-index.cpp +++ b/libsearch/index/first-index.cpp @@ -111,7 +111,7 @@ void FirstIndex::run(){ prctl(PR_SET_NAME,"first-index"); if (this->bool_dataBaseExist){ if (this->bool_dataBaseStatusOK){ - ::exit(0); + ::_exit(0); } else{ //if the parameter is false, index won't be rebuild @@ -169,7 +169,7 @@ void FirstIndex::run(){ if (p_indexGenerator) delete p_indexGenerator; p_indexGenerator = nullptr; - ::exit(0); + ::_exit(0); } else if(pid < 0) { diff --git a/libsearch/index/inotify-index.cpp b/libsearch/index/inotify-index.cpp index 216e4de..de9fedd 100644 --- a/libsearch/index/inotify-index.cpp +++ b/libsearch/index/inotify-index.cpp @@ -419,7 +419,7 @@ fork: qDebug() << "select timeout!"; ::free(read_timeout); IndexGenerator::getInstance()->~IndexGenerator(); - ::exit(0); + ::_exit(0); }else{ numRead = read(m_fd, buf, BUF_LEN); if (numRead == -1){ @@ -442,7 +442,7 @@ fork: //MouseZhangZh // connect(liveTime, &QTimer::timeout, [ = ](){ -//// ::exit(0); +//// ::_exit(0); // *b_timeout = 1; // }); // for (;;){ @@ -451,7 +451,7 @@ fork: // this->eventProcess(buf, numRead); // if (liveTime->remainingTime() < 1){ // qDebug() << "liveTime->remainingTime():" << liveTime->remainingTime(); -// ::exit(0); +// ::_exit(0); // } // }