diff dbutil.c @ 173:257f09a63dab

* add SSH_ASKPASS support (based on patch from Paul Whittaker * don't exit if setnonblocking() fails with "not supported by device" (allows redirection from /dev/null)
author Matt Johnston <matt@ucc.asn.au>
date Mon, 28 Feb 2005 13:01:00 +0000
parents 3e49d8d18005
children 65585699d980
line wrap: on
line diff
--- a/dbutil.c	Mon Feb 28 10:15:16 2005 +0000
+++ b/dbutil.c	Mon Feb 28 13:01:00 2005 +0000
@@ -627,7 +627,13 @@
 	TRACE(("setnonblocking: %d", fd))
 
 	if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
-		dropbear_exit("Couldn't set nonblocking");
+		if (errno == ENODEV) {
+			/* Some devices (like /dev/null redirected in)
+			 * can't be set to non-blocking */
+			TRACE(("ignoring ENODEV for setnonblocking"))
+		} else {
+			dropbear_exit("Couldn't set nonblocking");
+		}
 	}
 	TRACE(("leave setnonblocking"))
 }