From d4c613e3e687d8e56c5047b813f263fdaf32fd95 Mon Sep 17 00:00:00 2001 From: zhangzihao Date: Fri, 22 Jan 2021 10:51:06 +0800 Subject: [PATCH] Fixed an issue where the monitor would not start the next time the application exits normally. --- libsearch/index/first-index.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libsearch/index/first-index.cpp b/libsearch/index/first-index.cpp index 5412d52..52e341a 100644 --- a/libsearch/index/first-index.cpp +++ b/libsearch/index/first-index.cpp @@ -77,6 +77,12 @@ void FirstIndex::run(){ if (this->bool_dataBaseExist){ if (this->bool_dataBaseStatusOK){ + int retval = write(fifo_fd, buffer, strlen(buffer)); + if(retval == -1) + { + perror("write error\n"); + } + printf("write data ok!\n"); //why??????????????????????????????????????????????????????????????? //why not quit? @@ -183,7 +189,6 @@ void FirstIndex::run(){ perror("write error\n"); } printf("write data ok!\n"); - close(fifo_fd); FileUtils::_index_status = FINISH_CREATING_INDEX;