use execv and pass non-inline argument for gcc

This commit is contained in:
Konstantin Käfer
2014-11-04 06:45:06 -08:00
parent 75889d8124
commit 67eae5724a

View File

@@ -28,7 +28,8 @@ public:
if (pid < 0) {
throw std::runtime_error("Cannot create web server");
} else if (pid == 0) {
int ret = execve((base_directory + "bin/server.py").c_str(), { nullptr }, { nullptr });
char *arg[] = { nullptr };
int ret = execv((base_directory + "bin/server.py").c_str(), arg);
// This call should not return. In case execve failed, we exit anyway.
if (ret < 0) {
fprintf(stderr, "Failed to start server: %s\n", strerror(errno));