From a790d1766e7b87986475130131d18d6608f339b5 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 13 Feb 2016 23:37:21 +0100 Subject: [PATCH] Fixed: Wait until Ryzom client is released from memory before to launch the new client --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 445da2ff3..c78a239de 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -892,6 +892,13 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool #ifdef NL_OS_WINDOWS fprintf(fp, "start \"\" \"%s\" %%1 %%2 %%3\n", CPath::standardizeDosPath(RyzomFilename).c_str()); #else + // wait until client is not in memory + fprintf(fp, "until ! pgrep %s > /dev/null; do sleep 1; done\n", CFile::getFilename(RyzomFilename).c_str()); + + // be sure file is executable + fprintf(fp, "chmod +x \"%s\"\n", RyzomFilename.c_str()); + + // launch new client fprintf(fp, "\"%s\" $1 $2 $3\n", RyzomFilename.c_str()); #endif }