comparison gensignkey.c @ 983:2b62f26cf808

Open directories O_RDONLY for fsync, add debugging if it fails
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Jan 2015 22:22:43 +0800
parents fd2e8bbb0333
children 2bb4c662d1c2
comparison
equal deleted inserted replaced
982:fd2e8bbb0333 983:2b62f26cf808
39 39
40 ret = DROPBEAR_SUCCESS; 40 ret = DROPBEAR_SUCCESS;
41 41
42 out: 42 out:
43 if (fd >= 0) { 43 if (fd >= 0) {
44 fsync(fd); 44 if (fsync(fd) != 0) {
45 dropbear_log(LOG_ERR, "fsync of %s failed: %s", filename, strerror(errno));
46 }
45 m_close(fd); 47 m_close(fd);
46 } 48 }
47 return ret; 49 return ret;
48 } 50 }
49 51