diff options
author | Christian Hesse <mail@eworm.de> | 2020-11-25 08:48:37 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-11-25 08:48:37 +0100 |
commit | ed06fb5d80bc0425a00860aec2db119189c4ee97 (patch) | |
tree | 04eb5af5700f7dcfe1cfcec1b0cd1648859b7961 /bin/ykfde.c | |
parent | e7ceabd8096686f9893286464a58693e4d09b44f (diff) | |
download | mkinitcpio-ykfde-ed06fb5d80bc0425a00860aec2db119189c4ee97.tar.gz mkinitcpio-ykfde-ed06fb5d80bc0425a00860aec2db119189c4ee97.tar.zst |
sync challenge file to disk before closing
Diffstat (limited to 'bin/ykfde.c')
-rw-r--r-- | bin/ykfde.c | 4 |
1 files changed, 4 insertions, 0 deletions
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... |