break;
case 0 : //the forked process
int exitval;
- char *xx;
- char *rootpath;
char *execpath;
+ char *argv[10];
char buffer[300];
exitval=0;
- rootpath=(char *)0;
- xx=(char *)0;
- if (rootdir!=(char *)0) {
- xx="-r";
- rootpath=rootdir;
- }
+ (void) memset(argv,'\000',sizeof(argv));
(void) snprintf(buffer,sizeof(buffer),"%s%s",SBINDIR,SENDER);
execpath=rou_apppath(buffer);
(void) snprintf(buffer,sizeof(buffer),"%s.%s",todo,EXTODO);
- (void) rou_alert(0,"%s JMPDBG starting sender=<%s> testing=<%s> todo= <%s>",OPEP,execpath,rootpath,buffer);
- if (execl(execpath,"Bigre","-c",config,buffer,xx,rootpath,(char *)0)<0) {
+ argv[0]=SENDER;
+ argv[1]="-c";
+ argv[2]=config;
+ argv[3]=buffer;
+ if (rootdir!=(char *)0) {
+ argv[3]="-r";
+ argv[4]=rootdir;
+ argv[5]=buffer;
+ }
+ (void) rou_alert(0,"%s JMPDBG starting sender=<%s> todo= <%s>",
+ OPEP,execpath,buffer);
+ if (execv(execpath,argv)<0) {
(void) rou_alert(0,"%s Unable to exec process=<%s> (error=<%s> Bug?)",
OPEP,execpath,strerror(errno));
exitval=-1;
}
+ (void) rou_freestr(execpath);
(void) exit(exitval);
break;
default : //the forking process itself