Make sure hostkeys are flushed to disk to avoid empty files if the power

fails. Based on patch from Peter Korsgaard
This commit is contained in:
Matt Johnston
2014-11-08 22:15:16 +08:00
parent 3022a46039
commit 4ba830fc31
2 changed files with 23 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ static int buf_writefile(buffer * buf, const char * filename) {
out:
if (fd >= 0) {
fsync(fd);
m_close(fd);
}
return ret;