# HG changeset patch # User Matt Johnston # Date 1571413696 -28800 # Node ID 7402218141d4af3bec95929226ce5f0e435313a2 # Parent 823592f244c913d5a89ee9b0d9ca6cdf8737da53 bring back fsync_parent_dir diff -r 823592f244c9 -r 7402218141d4 gensignkey.c --- a/gensignkey.c Tue Sep 17 22:26:03 2019 +0800 +++ b/gensignkey.c Fri Oct 18 23:48:16 2019 +0800 @@ -152,6 +152,10 @@ } } + /* 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);