Skip to content
Snippets Groups Projects
Commit 37a61c38 authored by tewk's avatar tewk
Browse files

added execle line to task_mgr.c to automatically setup the env

changed unpack_strarray to null terminate the array of strings
parent 4f5ba8b1
No related branches found
No related tags found
No related merge requests found
......@@ -268,11 +268,12 @@ _unpackstrarray (char ***valp, uint16_t *size_valp, void **bufp, int *lenp)
*lenp -= sizeof(nl);
if (*size_valp > 0) {
*valp = xmalloc(sizeof ( char * ) * *size_valp ) ;
*valp = xmalloc(sizeof ( char * ) * ( *size_valp +1 ) ) ;
for ( i = 0 ; i < *size_valp ; i ++ )
{
unpackstr_xmalloc ( & (*valp)[i] , & uint16_tmp , bufp , lenp ) ;
}
(*valp)[i] = NULL ; /* NULL terminated array so that execle can detect end of array */
}
else
*valp = NULL;
......
......@@ -316,12 +316,11 @@ void * task_exec_thread ( void * arg )
/* set session id */
/* setup requested env */
//setup_task_env ( task_arg ) ;
/* run bash and cmdline */
chdir ( launch_msg->cwd ) ;
execl ( "/bin/bash" , "bash" , "-c" , launch_msg->cmd_line );
execl ( "/bin/sh", launch_msg->cmd_line );
//execle ( "/bin/sh", launch_msg->cmd_line , launch_msg->env );
_exit ( SLURM_SUCCESS ) ;
default: /*parent proccess */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment