summaryrefslogtreecommitdiffhomepage
path: root/gensignkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-01-04 22:22:43 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-01-04 22:22:43 +0800
commit634415f79e7bb13e9831186121009f407c23a5fc (patch)
treeab665c5593038237143adc8a77821ec581bfdc28 /gensignkey.c
parent4ba830fc31c056aaada774ce29bb7d4e136b5dcd (diff)
Open directories O_RDONLY for fsync, add debugging if it fails
Diffstat (limited to 'gensignkey.c')
-rw-r--r--gensignkey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gensignkey.c b/gensignkey.c
index 06fdfd3..e6c40e0 100644
--- a/gensignkey.c
+++ b/gensignkey.c
@@ -41,7 +41,9 @@ static int buf_writefile(buffer * buf, const char * filename) {
out:
if (fd >= 0) {
- fsync(fd);
+ if (fsync(fd) != 0) {
+ dropbear_log(LOG_ERR, "fsync of %s failed: %s", filename, strerror(errno));
+ }
m_close(fd);
}
return ret;