-
- execl(executablePath, executablePath, (char*)(NULL)); ///Replace process with desired executable
- //fprintf(stderr, "Program::Program - Could not run program \"%s\"!\n", executablePath);
- //exit(EXIT_FAILURE); //We will probably have to terminate the whole program if this happens
+ if (access(executablePath, X_OK) == 0) //Check we STILL have permissions to start the file
+ execl(executablePath, executablePath, (char*)(NULL)); ///Replace process with desired executable
+
+ fprintf(stderr, "Program::Program - Could not run program \"%s\"!\n", executablePath);
+ exit(EXIT_FAILURE); //We will probably have to terminate the whole program if this happens