From ed06fb5d80bc0425a00860aec2db119189c4ee97 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 25 Nov 2020 08:48:37 +0100 Subject: sync challenge file to disk before closing --- bin/ykfde.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ykfde.c b/bin/ykfde.c index 56a2832..8a766e5 100644 --- a/bin/ykfde.c +++ b/bin/ykfde.c @@ -312,6 +312,10 @@ int main(int argc, char **argv) { fprintf(stderr, "Failed to write challenge to file.\n"); goto out50; } + if (fsync(challengefiletmp) < 0) { + fprintf(stderr, "Failed to sync file to disk.\n"); + goto out50; + } challengefiletmp = close(challengefiletmp); /* now that the new challenge has been written to file... -- cgit v1.2.3-70-g09d2