use execv and pass non-inline argument for gcc
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user