Skip to content
Snippets Groups Projects
Commit f260ecb0 authored by Mark Grondona's avatar Mark Grondona
Browse files

o io.c : fixed bug when opening stderr stream

 o reattach.c : fixed search for matching job id.
parent 9b479e54
No related branches found
No related tags found
No related merge requests found
...@@ -388,7 +388,7 @@ _stdin_open(char *filename) ...@@ -388,7 +388,7 @@ _stdin_open(char *filename)
xassert(filename != NULL); xassert(filename != NULL);
if ((fd = open(filename, flags, 0644)) < 0) { if ((fd = open(filename, flags, 0644)) < 0) {
error ("Unable to open `%s': %m", filename); error ("Unable to open `%s' for stdin: %m", filename);
return -1; return -1;
} }
fd_set_nonblocking(fd); fd_set_nonblocking(fd);
...@@ -400,8 +400,11 @@ static FILE * ...@@ -400,8 +400,11 @@ static FILE *
_fopen(char *filename) _fopen(char *filename)
{ {
FILE *fp; FILE *fp;
xassert(filename != NULL);
if (!(fp = fopen(filename, "w"))) if (!(fp = fopen(filename, "w")))
error ("Unable to open file `%s': %m", filename); error ("Unable to open file `%s' for writing: %m", filename);
return fp; return fp;
} }
...@@ -420,7 +423,7 @@ _open_streams(job_t *job) ...@@ -420,7 +423,7 @@ _open_streams(job_t *job)
job->outstream = stdout; job->outstream = stdout;
if ((job->efname->type != IO_PER_TASK) && job->efname->name) if ((job->efname->type != IO_PER_TASK) && job->efname->name)
job->errstream = _fopen(job->ifname->name); job->errstream = _fopen(job->efname->name);
else else
job->errstream = stderr; job->errstream = stderr;
......
...@@ -199,8 +199,8 @@ _get_job_info(srun_step_t *s) ...@@ -199,8 +199,8 @@ _get_job_info(srun_step_t *s)
for (i = 0; i < resp->record_count; i++) { for (i = 0; i < resp->record_count; i++) {
job = &resp->job_array[i]; job = &resp->job_array[i];
if (job->job_id != s->jobid) if (job->job_id == s->jobid)
continue; break;
} }
if (job == NULL) { if (job == NULL) {
......
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