]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/rdi-share/unixcomm.c
import gdb-1999-11-01 snapshot
[thirdparty/binutils-gdb.git] / gdb / rdi-share / unixcomm.c
index 7c2183de3e5527dc50b5859b17cf8998f375a92a..86bffc045e2eff077095155ac277bcc68d84277a 100644 (file)
@@ -82,8 +82,8 @@
 #endif
 
 #ifdef __linux__
-#define SERPORT1   "/dev/cua0"
-#define SERPORT2   "/dev/cua1"
+#define SERPORT1   "/dev/ttyS0"
+#define SERPORT2   "/dev/ttyS1"
 #define PARPORT1   "/dev/par0"
 #define PARPORT2   "/dev/par1"
 #endif
@@ -287,7 +287,14 @@ extern int Unix_ReadSerial(unsigned char *buf, int n, bool block)
         return -1;
     }
     else if (err > 0 && FD_ISSET(serpfd, &fdset))
-        return read(serpfd, buf, n);
+      {
+       int s;
+
+       s = read(serpfd, buf, n);
+       if (s < 0)
+         perror("read:");
+       return s;
+      }
     else /* err == 0 || FD_CLR(serpfd, &fdset) */
     {
         errno = ERRNO_FOR_BLOCKED_IO;
@@ -305,15 +312,6 @@ extern void Unix_ResetSerial(void)
     struct termios terminfo;
 
     tcgetattr(serpfd, &terminfo);
-#ifdef __CYGWIN32__
-    /* Expedient, but it works.  */
-    terminfo.c_iflag = 0;
-    terminfo.c_oflag = 0;
-    terminfo.c_cflag = 48;
-    terminfo.c_lflag = 0;
-    terminfo.c_cc[VMIN] = 0;
-    terminfo.c_cc[VTIME] = 1;
-#else
     terminfo.c_lflag &= ~(ICANON | ISIG | ECHO | IEXTEN);
     terminfo.c_iflag &= ~(IGNCR | INPCK | ISTRIP | ICRNL | BRKINT);
     terminfo.c_iflag |= (IXON | IXOFF | IGNBRK);
@@ -322,7 +320,6 @@ extern void Unix_ResetSerial(void)
     terminfo.c_cc[VMIN] = 1;
     terminfo.c_cc[VTIME] = 0;
     terminfo.c_oflag &= ~OPOST;
-#endif
     tcsetattr(serpfd, TCSAFLUSH, &terminfo);
 }