Skip to content

Commit

Permalink
eliminate children
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Jan 21, 2025
1 parent 306d959 commit 3ade33b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dMasterServer/MasterServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
#include "CDZoneTableTable.h"
#include "eGameMasterLevel.h"

#ifdef DARKFLAME_PLATFORM_UNIX

#include <sys/types.h>
#include <sys/wait.h>

#endif

namespace Game {
Logger* logger = nullptr;
dServer* server = nullptr;
Expand Down Expand Up @@ -455,6 +462,12 @@ int main(int argc, char** argv) {
}
}

#ifdef DARKFLAME_PLATFORM_UNIX
// kill off dead zombie instances
int status{};
waitpid(static_cast<pid_t>(-1), &status, WNOHANG);
#endif

t += std::chrono::milliseconds(masterFrameDelta);
std::this_thread::sleep_until(t);
}
Expand Down

0 comments on commit 3ade33b

Please sign in to comment.