From cc9a11af67b03f18d2ec339e730f3de3a448138e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 1 Sep 2020 16:04:51 +0200 Subject: SLURM: Don't crash if stderr file can't be read --- src/gui_backend_slurm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui_backend_slurm.c') 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; -- cgit v1.2.3