Skip to content

Commit

Permalink
Merge pull request #42 from brmmm3/master
Browse files Browse the repository at this point in the history
Do not disable resume feature when direct io is enabled
  • Loading branch information
rico666 authored Jul 19, 2018
2 parents 2fa608d + 9160856 commit 929e26f
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -934,9 +932,7 @@ int main(int argc, char **argv) {
}
pthread_join(writeworker, NULL);
}
if (! use_direct_io) {
writestatus();
}
writestatus();

startnonce += staggersize;
}
Expand Down

0 comments on commit 929e26f

Please sign in to comment.