diff options
author | Thomas White <taw@physics.org> | 2020-09-01 16:04:51 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-09-01 16:04:51 +0200 |
commit | cc9a11af67b03f18d2ec339e730f3de3a448138e (patch) | |
tree | 4d7fa4c9764c7b1b831663578fa475f4b50a8e9e /src | |
parent | 6b3389b5b96efd28b70ab4258bc77f59da6b01ea (diff) |
SLURM: Don't crash if stderr file can't be read
Diffstat (limited to 'src')
-rw-r--r-- | src/gui_backend_slurm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui_backend_slurm.c b/src/gui_backend_slurm.c index 9f9ce920..597c3636 100644 --- a/src/gui_backend_slurm.c +++ b/src/gui_backend_slurm.c @@ -64,6 +64,9 @@ static int read_number_processed(const char *filename) FILE *fh = fopen(filename, "r"); int n_proc; + /* Normal situation if SLURM job hasn't started yet */ + if ( fh == NULL ) return 0; + do { char line[1024]; if ( fgets(line, 1024, fh) == NULL ) break; |