aboutsummaryrefslogtreecommitdiffstats
path: root/src/serial.c
diff options
context:
space:
mode:
authorstaffcvs <>2008-02-23 13:05:58 +0000
committerstaffcvs <>2008-02-23 13:05:58 +0000
commit667353b64b552aff9e785a20ee915fb343a0dac9 (patch)
tree3280757c1de4b64cac357a207160fe794e70f275 /src/serial.c
parentfc338d9b30500f311d9555545477e4ba1775b403 (diff)
downloadsympathy-667353b64b552aff9e785a20ee915fb343a0dac9.tar.gz
sympathy-667353b64b552aff9e785a20ee915fb343a0dac9.tar.bz2
sympathy-667353b64b552aff9e785a20ee915fb343a0dac9.zip
*** empty log message ***
Diffstat (limited to 'src/serial.c')
-rw-r--r--src/serial.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/serial.c b/src/serial.c
index bd4450c..3784573 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.8 2008/02/23 13:05:58 staffcvs
+ * *** empty log message ***
+ *
* Revision 1.7 2008/02/15 23:52:12 james
* *** empty log message ***
*
@@ -163,12 +166,25 @@ serial_open (char *path, int lock_mode)
if (!l)
return NULL;
- default_termios (&termios);
fd = open (path, O_RDWR | O_NOCTTY | O_NONBLOCK);
set_nonblocking (fd);
+
+ if (tcgetattr (fd, &termios))
+ {
+ close (fd);
+ return NULL;
+ }
+ default_termios (&termios);
+
+ if (tcsetattr (fd, TCSANOW, &termios))
+ {
+ close (fd);
+ return NULL;
+ }
+
t = (Serial *) malloc (sizeof (Serial));
t->lock = l;