Merge pull request #175 from iaom/0313-dev

[Fix] mkfifo fail when fifo path is not exits;
This commit is contained in:
Mouse Zhang 2021-03-14 10:05:31 +08:00 committed by GitHub
commit caac46c16c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -145,6 +145,11 @@ int main(int argc, char *argv[])
printf("Home not exits!!"); printf("Home not exits!!");
::sleep(1); ::sleep(1);
} }
QDir fifoDir = QDir(QDir::homePath()+"/.config/org.ukui/ukui-search");
if(!fifoDir.exists())
qDebug()<<"create fifo path"<<fifoDir.mkpath(fifoDir.absolutePath());
unlink(UKUI_SEARCH_PIPE_PATH); unlink(UKUI_SEARCH_PIPE_PATH);
int retval = mkfifo(UKUI_SEARCH_PIPE_PATH, 0777); int retval = mkfifo(UKUI_SEARCH_PIPE_PATH, 0777);
if(retval == -1) if(retval == -1)