Revision 996
fixed the environment variable stuff
robot.c | ||
---|---|---|
100 | 100 |
|
101 | 101 |
if(!pid) |
102 | 102 |
{ |
103 |
char var[21];
|
|
104 |
char *envp[] = {var, NULL};
|
|
105 |
/* restore default sigchld handler */
|
|
106 |
signal(SIGCHLD, SIG_DFL);
|
|
107 |
sprintf(var, "memory_id=%d", r->sharedMemID);
|
|
108 |
//TODO: keep the other env. stuff around
|
|
109 |
execve(execname, NULL, envp);
|
|
110 |
fprintf(stderr, "exec failed to run child process.\n");
|
|
111 |
exit(-1);
|
|
103 |
char var[21];
|
|
104 |
/* restore default sigchld handler */
|
|
105 |
signal(SIGCHLD, SIG_DFL);
|
|
106 |
sprintf(var, "memory_id=%d", r->sharedMemID);
|
|
107 |
putenv(var);
|
|
108 |
//TODO: keep the other env. stuff around
|
|
109 |
execv(execname, NULL);
|
|
110 |
fprintf(stderr, "exec failed to run child process.\n");
|
|
111 |
exit(-1);
|
|
112 | 112 |
} |
113 | 113 |
else |
114 | 114 |
{ |
Also available in: Unified diff