Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
306:5d5bbca82aba | 307:24b19535264b |
---|---|
609 return ret; | 609 return ret; |
610 } | 610 } |
611 | 611 |
612 static void serial_connect(struct Channel *channel) { | 612 static void serial_connect(struct Channel *channel) { |
613 | 613 |
614 int serial_fd; | 614 int serial_fd; |
615 | 615 |
616 serial_fd = open(SERIAL_DEVICE, O_RDWR | O_NOCTTY, 0); | 616 TRACE(("enter serial_connect")) |
617 if (serial_fd < 0) { | 617 |
618 dropbear_exit("Failed opening '%s': %d %s", SERIAL_DEVICE, | 618 serial_fd = open(SERIAL_DEVICE, O_RDWR | O_NOCTTY, 0); |
619 errno, strerror(errno)); | 619 TRACE(("serial_fd = %d", serial_fd)) |
620 } | 620 if (serial_fd < 0) { |
621 | 621 TRACE(("errno %d", errno)) |
622 /* XXX TODO - code to set the serial fd to the right baud/settings etc */ | 622 dropbear_exit("Failed opening '%s': %d %s", SERIAL_DEVICE, |
623 | 623 errno, strerror(errno)); |
624 ses.maxfd = MAX(serial_fd, channel->writefd); | 624 } |
625 setnonblocking(serial_fd); | 625 |
626 | 626 TRACE(("success serial_connect")) |
627 channel->writefd = serial_fd; | 627 /* XXX TODO - code to set the serial fd to the right baud/settings etc */ |
628 channel->readfd = serial_fd; | 628 |
629 ses.maxfd = MAX(serial_fd, channel->writefd); | |
630 setnonblocking(serial_fd); | |
631 | |
632 channel->writefd = serial_fd; | |
633 channel->readfd = serial_fd; | |
629 } | 634 } |
630 | 635 |
631 /* Execute a command and set up redirection of stdin/stdout/stderr without a | 636 /* Execute a command and set up redirection of stdin/stdout/stderr without a |
632 * pty. | 637 * pty. |
633 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ | 638 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ |