The unified diff between revisions [4c883eb4..] and [fff0894a..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'dbutil.c'
#
#
# patch "dbutil.c"
# from [bcd256f4bdc8183dfd6b813375c39af6513b183d]
# to [4849b88af194476f39b4aa8fe3647e64e52b85a7]
#
============================================================
--- dbutil.c bcd256f4bdc8183dfd6b813375c39af6513b183d
+++ dbutil.c 4849b88af194476f39b4aa8fe3647e64e52b85a7
@@ -588,20 +588,17 @@ out:
}
#endif
-/* loop until the socket is closed (in case of EINTR) or
- * we get and error.
- * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
-int m_close(int fd) {
+/* make sure that the socket closes */
+void m_close(int fd) {
int val;
do {
val = close(fd);
} while (val < 0 && errno == EINTR);
- if (val == 0 || errno == EBADF) {
- return DROPBEAR_SUCCESS;
- } else {
- return DROPBEAR_FAILURE;
+ if (val < 0 && errno != EBADF) {
+ /* Linux says EIO can happen */
+ dropbear_exit("Error closing fd %d, %s", fd, strerror(errno));
}
}