diff options
author | tsarna <tsarna> | 2003-06-25 15:12:16 +0000 |
---|---|---|
committer | tsarna <tsarna> | 2003-06-25 15:12:16 +0000 |
commit | db4929eff4ea914611861e62ef5c8a2c47898216 (patch) | |
tree | f5a0ba0ee163e8c19c9ad4ba4480928beb15ab7a /cross/icdprog/patches | |
parent | d479a027982a4732c2efac4c515e481648c9b4f9 (diff) | |
download | pkgsrc-db4929eff4ea914611861e62ef5c8a2c47898216.tar.gz |
Add some fixes to serial I/O
Diffstat (limited to 'cross/icdprog/patches')
-rw-r--r-- | cross/icdprog/patches/patch-ab | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cross/icdprog/patches/patch-ab b/cross/icdprog/patches/patch-ab new file mode 100644 index 00000000000..aa69b14ee50 --- /dev/null +++ b/cross/icdprog/patches/patch-ab @@ -0,0 +1,35 @@ +$NetBSD: patch-ab,v 1.1 2003/06/25 15:12:17 tsarna Exp $ + +--- icd.c.orig Sat Jun 21 17:05:22 2003 ++++ icd.c Sat Jun 21 17:30:45 2003 +@@ -278,7 +278,7 @@ + { + struct termios oldtio, newtio; + +- if((icd_fd=open(port, O_NOCTTY | O_RDWR | O_SYNC)) == -1) { ++ if((icd_fd=open(port, O_NOCTTY | O_RDWR | O_SYNC | O_NONBLOCK)) == -1) { + perror("Error opening device:"); + return -1; + } +@@ -286,10 +286,11 @@ + tcgetattr(icd_fd, &oldtio); + + memset(&newtio,0, sizeof(newtio)); +- newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD; ++ newtio.c_cflag = CS8 | CLOCAL | CREAD; + newtio.c_iflag = IGNPAR; + newtio.c_oflag = 0; + newtio.c_lflag = 0; ++ newtio.c_ispeed = newtio.c_ospeed = BAUDRATE; + + newtio.c_cc[VTIME] = 20; + newtio.c_cc[VMIN] = 0; +@@ -297,6 +298,8 @@ + tcflush(icd_fd, TCIFLUSH); + tcsetattr(icd_fd, TCSANOW, &newtio); + ++ fcntl(icd_fd, F_SETFL, 0); /* clear nonblock */ ++ + icd_hw_reset(); + + rts_set(); |