From 9160856fb093ab46918e72fff1c051ed27efc125 Mon Sep 17 00:00:00 2001 From: Martin Bammer Date: Sat, 23 Jun 2018 22:48:56 +0200 Subject: [PATCH] Do not disable resume feature when direct io is enabled --- plot.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/plot.c b/plot.c index 22dba4c..582348f 100644 --- a/plot.c +++ b/plot.c @@ -824,18 +824,16 @@ int main(int argc, char **argv) { printf("Done pre-allocating space.\n"); } // Write resume id to the end of the file - if (! use_direct_io) { - if ( LSEEK(ofd, -sizeof run - sizeof resumeid, SEEK_END) < 0 ) { - printf("\n\nError while lseek()ing in file: %d\n\n", errno); - exit(1); - } - if ( write(ofd, &resumeid, sizeof resumeid) < 0 ) { - perror("write"); - printf("\n\nError while writing to file: %d\n\n", errno); - exit(1); - } - writestatus(); + if ( LSEEK(ofd, -sizeof run - sizeof resumeid, SEEK_END) < 0 ) { + printf("\n\nError while lseek()ing in file: %d\n\n", errno); + exit(1); } + if ( write(ofd, &resumeid, sizeof resumeid) < 0 ) { + perror("write"); + printf("\n\nError while writing to file: %d\n\n", errno); + exit(1); + } + writestatus(); } // Threads: @@ -934,9 +932,7 @@ int main(int argc, char **argv) { } pthread_join(writeworker, NULL); } - if (! use_direct_io) { - writestatus(); - } + writestatus(); startnonce += staggersize; }