Commit 4024b3a3 authored by József Gyürüsi's avatar József Gyürüsi
Browse files

[internal #0] fixing f_EPTF_Base_executeShell to use sh/bash/tcsh to start the command



Change-Id: I72260ad0f2050ee4e735dd2445a7e47fdd107e32
Signed-off-by: József Gyürüsi's avatarJózsef Gyürüsi <jozsef.gyurusi@ericsson.com>
parent a864fab1
......@@ -202,7 +202,7 @@ INTEGER EPTF__CLL__Base__Functions::f__EPTF__Base__executeShell(const CHARSTRING
}
argv[argc++] = (char*)NULL; // no additional args
*/
argv[0]=strdup("tcsh");
argv[0]=strdup("bash");
argv[1]=strdup("-c");
argv[2]=strdup(cmd);
argv[3]=NULL;
......@@ -212,15 +212,26 @@ INTEGER EPTF__CLL__Base__Functions::f__EPTF__Base__executeShell(const CHARSTRING
fprintf(stderr,"f_EPTF_Base_executeShell: Failed to start the %s",(const char*)argv[0]);
fflush(stdout);
fflush(stderr);
/*
argv[0]="tcsh";
argv[1]="-c";
argv[2]=(char*)(const char*)(CHARSTRING("exit ")+int2str(errno));
argv[3]=NULL;
if(execvp(argv[0],argv)< 0) {
fprintf(stderr,"f_EPTF_Base_executeShell: Failed to start the %s",(const char*)argv[0]);
}
*/
}
// this is not reached: if execvp is successful
// if bash fails, try tcsh
argv[0]=strdup("tcsh");
// execute
if(execvp(argv[0],argv) < 0) {
fprintf(stderr,"f_EPTF_Base_executeShell: Failed to start the %s",(const char*)argv[0]);
fflush(stdout);
fflush(stderr);
}
// this is not reached: if execvp is successful
// if tcsh fails, try sh
argv[0]=strdup("sh");
// execute
if(execvp(argv[0],argv) < 0) {
fprintf(stderr,"f_EPTF_Base_executeShell: Failed to start the %s",(const char*)argv[0]);
fflush(stdout);
fflush(stderr);
}
TTCN_Logger::log(TTCN_Logger::TTCN_DEBUG,"EXECVP FINISHED:");
// this is never reached: 2nd execvp is always successful
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment