diff svr-chansession.c @ 307:24b19535264b ucc-axis-hack

progress for serial logins
author matt-ucc@ucc.asn.au
date Sat, 25 Mar 2006 17:31:52 +0000
parents 5d5bbca82aba
children 6e5f8ce73bf2
line wrap: on
line diff
--- a/svr-chansession.c	Sat Mar 25 17:12:50 2006 +0000
+++ b/svr-chansession.c	Sat Mar 25 17:31:52 2006 +0000
@@ -611,21 +611,26 @@
 
 static void serial_connect(struct Channel *channel) {
 
-    int serial_fd;
+	int serial_fd;
 
-    serial_fd = open(SERIAL_DEVICE, O_RDWR | O_NOCTTY, 0);
-    if (serial_fd < 0) {
-        dropbear_exit("Failed opening '%s': %d %s", SERIAL_DEVICE, 
-                errno, strerror(errno));
-    }
+	TRACE(("enter serial_connect"))
 
-    /* XXX TODO - code to set the serial fd to the right baud/settings etc */
+	serial_fd = open(SERIAL_DEVICE, O_RDWR | O_NOCTTY, 0);
+	TRACE(("serial_fd = %d", serial_fd))
+	if (serial_fd < 0) {
+		TRACE(("errno %d", errno))
+		dropbear_exit("Failed opening '%s': %d %s", SERIAL_DEVICE, 
+				errno, strerror(errno));
+	}
 
-    ses.maxfd = MAX(serial_fd, channel->writefd);
-    setnonblocking(serial_fd);
+	TRACE(("success serial_connect"))
+	/* XXX TODO - code to set the serial fd to the right baud/settings etc */
 
-    channel->writefd = serial_fd;
-    channel->readfd = serial_fd;
+	ses.maxfd = MAX(serial_fd, channel->writefd);
+	setnonblocking(serial_fd);
+
+	channel->writefd = serial_fd;
+	channel->readfd = serial_fd;
 }
 
 /* Execute a command and set up redirection of stdin/stdout/stderr without a