Changeset 53 for trunk/pbs_drmaa


Ignore:
Timestamp:
01/07/12 22:35:59 (12 years ago)
Author:
mmamonski
Message:

on site fixies

Location:
trunk/pbs_drmaa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/session.c

    r52 r53  
    2222#endif 
    2323 
     24#include <pwd.h> 
    2425#include <stdlib.h> 
    2526#include <string.h> 
     
    115116                self->max_retries_count = 3; 
    116117                self->wait_thread_sleep_time = 1; 
     118                self->job_exit_status_file_prefix = NULL; 
    117119 
    118120                self->super.load_configuration( &self->super, "pbs_drmaa" ); 
     
    136138                 } 
    137139 
    138                  self->job_exit_status_file_prefix = NULL; 
    139140         } 
    140141        EXCEPT_DEFAULT 
     
    294295          } 
    295296 
    296         if (mkdir(pbsself->job_exit_status_file_prefix, 0600) == -1 && errno != EEXIST) /* TODO it would be much better to do stat before */ 
     297        fsd_log_debug(("Trying to create state directory: %s", pbsself->job_exit_status_file_prefix)); 
     298 
     299        if (mkdir(pbsself->job_exit_status_file_prefix, 0700) == -1 && errno != EEXIST) /* TODO it would be much better to do stat before */ 
    297300          { 
    298                 fsd_log_warning("Failed to create job state directory: %s.  Valid job exit status may not be available in some cases.", pbsself->job_exit_status_file_prefix) 
     301                fsd_log_warning(("Failed to create job state directory: %s. Valid job exit status may not be available in some cases.", pbsself->job_exit_status_file_prefix)); 
    299302          } 
    300303 
  • trunk/pbs_drmaa/submit.c

    r52 r53  
    336336                if( wd != NULL ) 
    337337                        script_len += strlen("cd ") + strlen(wd) + strlen("; "); 
    338                 script_len += strlen("exec ") + strlen(executable); 
     338                script_len += strlen(executable); 
    339339                if( argv != NULL ) 
    340340                        for( i = argv;  *i != NULL;  i++ ) 
     
    342342                if( input_path != NULL ) 
    343343                        script_len += strlen(" <") + strlen(input_path); 
    344                 if (((pbsdrmaa_session_t)self->session)->job_exit_status_file_prefix) 
    345                         script_len += strlen("; echo $? >") + strlen(((pbsdrmaa_session_t)self->session)->job_exit_status_file_prefix) + strlen("/$PBS_JOBID.exitcode"); 
     344                if (((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) 
     345                        script_len += strlen("; echo $? >") + strlen(((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) + strlen("/$PBS_JOBID.exitcode"); 
    346346         } 
    347347 
     
    353353                if( wd != NULL ) 
    354354                        s += sprintf( s, "cd %s; ", wd ); 
    355                 s += sprintf( s, "exec %s", executable ); 
     355                s += sprintf( s, "%s", executable ); 
    356356                if( argv != NULL ) 
    357357                        for( i = argv;  *i != NULL;  i++ ) 
     
    359359                if( input_path != NULL ) 
    360360                        s += sprintf( s, " <%s", input_path ); 
    361                 if (((pbsdrmaa_session_t)self->session)->job_exit_status_file_prefix) 
    362                         s += sprintf( s, "; echo $? >%s/$PBS_JOBID.exitcode", ((pbsdrmaa_session_t)self->session)->job_exit_status_file_prefix); 
     361                if (((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) 
     362                        s += sprintf( s, "; echo $? >%s/$PBS_JOBID.exitcode", ((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix); 
    363363 
    364364                fsd_assert( s == script+script_len ); 
Note: See TracChangeset for help on using the changeset viewer.