Skip to content

Commit

Permalink
修复编译失败
Browse files Browse the repository at this point in the history
  • Loading branch information
NIANIANKNIA committed Apr 15, 2024
1 parent b83a543 commit 9875100
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions NIAHttpBOT/src/NIAHttpBOT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ signed int main(signed int argc, char** argv) {
//初始化文件API
init_file_API(svr);

//监听reload命令
//监听终端命令输入
std::thread inputThread([&]() {
std::string command;
bool hasCommand = false;
Expand All @@ -196,7 +196,13 @@ signed int main(signed int argc, char** argv) {
hasCommand = true;
INFO("1s后重启NiaHttp-BOT...");
std::this_thread::sleep_for(std::chrono::seconds(1));
std::system(("start cmd /k " + std::string(argv[0])).c_str());
#ifdef _WIN32
std::system(("start cmd /k " + std::string(argv[0])).c_str());
#else
if (fork() == 0) {
execl(argv[0], argv[0], (char*)NULL);
}
#endif
exit(0);
}
//停止指令
Expand Down

0 comments on commit 9875100

Please sign in to comment.