aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-04 12:19:44 +0100
committerThomas White <taw@physics.org>2021-03-04 12:21:36 +0100
commit6ebf9236668e365f836da7b4eee75cce74ba25d2 (patch)
tree95a2967748d772a63590ce2b47f24f018dc26e46
parente49c4d6603c10f1b5da73c75ff39c477a0442c1a (diff)
read_number_processed: Only look at end of log file
-rw-r--r--src/gui_index.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index 589e0281..98f8a84c 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -799,6 +799,9 @@ int read_number_processed(const char *filename)
/* Normal situation if SLURM job hasn't started yet */
if ( fh == NULL ) return 0;
+ /* Only look at the last part of the file */
+ fseek(fh, -4096, SEEK_END);
+
do {
char line[1024];
if ( fgets(line, 1024, fh) == NULL ) break;