Skip to content

Commit

Permalink
bring back fsync_parent_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj committed Oct 18, 2019
1 parent 8f123fb commit b2007be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gensignkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ int signkey_generate(enum signkey_type keytype, int bits, const char* filename,
}
}

/* ensure directory update is flushed to disk, otherwise we can end up
with zero-byte hostkey files if the power goes off */
fsync_parent_dir(filename);

out:
if (buf) {
buf_burn(buf);
Expand Down

0 comments on commit b2007be

Please sign in to comment.