Merge pull request #104 from MouseZhangZh/0122-dev

🔒🔒🔒Changed _exit to exit.
This commit is contained in:
iaom 2021-01-23 11:36:28 +08:00 committed by GitHub
commit 6ce4490da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View File

@ -151,7 +151,7 @@ void FirstIndex::run(){
mutex1.unlock();
mutex2.unlock();
mutex3.unlock();
_exit(0);
::exit(0);

View File

@ -353,7 +353,7 @@ fork:
}
else if ( rc == 0 ) {
qDebug() << "select timeout!";
_exit(0);
::exit(0);
}else{
numRead = read(m_fd, buf, BUF_LEN);
if (numRead == -1){
@ -375,7 +375,7 @@ fork:
//MouseZhangZh
// connect(liveTime, &QTimer::timeout, [ = ](){
//// _exit(0);
//// ::exit(0);
// *b_timeout = 1;
// });
// for (;;){
@ -384,7 +384,7 @@ fork:
// this->eventProcess(buf, numRead);
// if (liveTime->remainingTime() < 1){
// qDebug() << "liveTime->remainingTime():" << liveTime->remainingTime();
// _exit(0);
// ::exit(0);
// }
// }
}

View File

@ -36,15 +36,23 @@
void handler(int){
qDebug() << "Recieved SIGTERM!";
GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE, "2");
GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE, "2");
GlobalSettings::getInstance()->setValue(INDEX_GENERATOR_NORMAL_EXIT, "2");
GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "2");
GlobalSettings::getInstance()->forceSync(INDEX_DATABASE_STATE);
GlobalSettings::getInstance()->forceSync(CONTENT_INDEX_DATABASE_STATE);
GlobalSettings::getInstance()->forceSync(INDEX_GENERATOR_NORMAL_EXIT);
GlobalSettings::getInstance()->forceSync(INOTIFY_NORMAL_EXIT);
qDebug() << "indexDataBaseStatus: " << GlobalSettings::getInstance()->getValue(INDEX_DATABASE_STATE).toString();
qDebug() << "contentIndexDataBaseStatus: " << GlobalSettings::getInstance()->getValue(CONTENT_INDEX_DATABASE_STATE).toString();
_exit(0);
::exit(0);
// InotifyIndex::getInstance("/home")->~InotifyIndex();