bring back fsync_parent_dir

This commit is contained in:
Matt Johnston 2019-10-18 23:48:16 +08:00
parent 8f123fb618
commit b2007beeb0

View File

@ -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);