diff gensignkey.c @ 982:fd2e8bbb0333

Make sure hostkeys are flushed to disk to avoid empty files if the power fails. Based on patch from Peter Korsgaard
author Matt Johnston <matt@ucc.asn.au>
date Sat, 08 Nov 2014 22:15:16 +0800
parents 6e6ae84d3dba
children 2b62f26cf808
line wrap: on
line diff
--- a/gensignkey.c	Thu Oct 23 22:09:46 2014 +0800
+++ b/gensignkey.c	Sat Nov 08 22:15:16 2014 +0800
@@ -41,6 +41,7 @@
 
 out:
 	if (fd >= 0) {
+		fsync(fd);
 		m_close(fd);
 	}
 	return ret;