1
0
Fork 0

Use execvp instead of execv and handle error. (#10103)

This commit is contained in:
Max Neunhöffer 2019-09-30 09:57:54 +02:00 committed by KVS85
parent 0757cf2b92
commit 587cead36f
1 changed files with 3 additions and 1 deletions

View File

@ -416,6 +416,8 @@ int main(int argc, char* argv[]) {
if (res != 0) {
std::cerr << "WARNING: could not change into directory '" << workdir << "'" << std::endl;
}
execv(argv[0], argv);
if (execvp(argv[0], argv) == -1) {
std::cerr << "WARNING: could not execp ourselves, restore will not work!" << std::endl;
}
#endif
}