aboutsummaryrefslogtreecommitdiffstats
path: root/BeckmannEgle.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-04-27 05:04:57 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-04-27 05:04:57 +0000
commit850d421bcdf6f502f9e8e0b8be3ba4c75f31a82c (patch)
tree28dd45bfdc2b53e3d1be653408d485419a49a410 /BeckmannEgle.c
parent7bd45509770b7daf6c7e083b9e584dccf0aacb7f (diff)
downloadlcd4linux-850d421bcdf6f502f9e8e0b8be3ba4c75f31a82c.tar.gz
[lcd4linux @ 2001-04-27 05:04:57 by reinelt]
replaced OPEN_MAX with sysconf() replaced mktemp() with mkstemp() unlock serial port if open() fails git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@132 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--BeckmannEgle.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/BeckmannEgle.c b/BeckmannEgle.c
index bc6055e..51bf98e 100644
--- a/BeckmannEgle.c
+++ b/BeckmannEgle.c
@@ -1,4 +1,4 @@
-/* $Id: BeckmannEgle.c,v 1.5 2001/02/13 09:00:13 reinelt Exp $
+/* $Id: BeckmannEgle.c,v 1.6 2001/04/27 05:04:57 reinelt Exp $
*
* driver for Beckmann+Egle mini terminals
*
@@ -20,6 +20,12 @@
*
*
* $Log: BeckmannEgle.c,v $
+ * Revision 1.6 2001/04/27 05:04:57 reinelt
+ *
+ * replaced OPEN_MAX with sysconf()
+ * replaced mktemp() with mkstemp()
+ * unlock serial port if open() fails
+ *
* Revision 1.5 2001/02/13 09:00:13 reinelt
*
* prepared framework for GPO's (general purpose outputs)
@@ -137,10 +143,12 @@ static int BE_open (void)
fd = open(Port, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd==-1) {
error ("BeckmannEgle: open(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
if (tcgetattr(fd, &portset)==-1) {
error ("BeckmannEgle: tcgetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
cfmakeraw(&portset); // 8N1
@@ -148,6 +156,7 @@ static int BE_open (void)
cfsetospeed(&portset, B9600); // 9600 baud
if (tcsetattr(fd, TCSANOW, &portset)==-1) {
error ("BeckmannEgle: tcsetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
return fd;