Created
March 21, 2010 22:52
-
-
Save spullara/339617 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/node-supervisor.c b/src/node-supervisor.c | |
| index 3e807d2..5569489 100644 | |
| --- a/src/node-supervisor.c | |
| +++ b/src/node-supervisor.c | |
| @@ -1,11 +1,16 @@ | |
| #define NODE_SUPERVISOR "/usr/local/lib/node-supervisor/cli-wrapper.js" | |
| #include <unistd.h> | |
| +#include <stdlib.h> | |
| int main (int argc, char** argv) { | |
| - return execl( | |
| + char** argv2 = malloc(sizeof(char*) * (2 + argc)); | |
| + int i; | |
| + argv2[0] = "node"; | |
| + argv2[1] = NODE_SUPERVISOR; | |
| + for (i = 0; i < argc; i++) { | |
| + argv2[i+2] = argv[i]; | |
| + } | |
| + return execv( | |
| NODE_BIN, | |
| - "node", | |
| - NODE_SUPERVISOR, | |
| - argv[argc - 1], | |
| - (char *)NULL | |
| + argv2 | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment