aboutsummaryrefslogtreecommitdiffstats
path: root/MatrixOrbital.c
diff options
context:
space:
mode:
authorreinelt <>2001-04-27 05:04:57 +0000
committerreinelt <>2001-04-27 05:04:57 +0000
commit5cbe3de330c73d872a58699bf49ae42125c67b11 (patch)
tree28dd45bfdc2b53e3d1be653408d485419a49a410 /MatrixOrbital.c
parent2c64f2a07f139e300151f9e7e30333a8ab041c6e (diff)
downloadlcd4linux-5cbe3de330c73d872a58699bf49ae42125c67b11.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
Diffstat (limited to 'MatrixOrbital.c')
-rw-r--r--MatrixOrbital.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/MatrixOrbital.c b/MatrixOrbital.c
index b2ae3e7..6c35632 100644
--- a/MatrixOrbital.c
+++ b/MatrixOrbital.c
@@ -1,4 +1,4 @@
-/* $Id: MatrixOrbital.c,v 1.21 2001/02/14 07:40:16 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.22 2001/04/27 05:04:57 reinelt Exp $
*
* driver for Matrix Orbital serial display modules
*
@@ -20,6 +20,12 @@
*
*
* $Log: MatrixOrbital.c,v $
+ * Revision 1.22 2001/04/27 05:04:57 reinelt
+ *
+ * replaced OPEN_MAX with sysconf()
+ * replaced mktemp() with mkstemp()
+ * unlock serial port if open() fails
+ *
* Revision 1.21 2001/02/14 07:40:16 reinelt
*
* first (incomplete) GPO implementation
@@ -184,16 +190,19 @@ static int MO_open (void)
fd = open(Port, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd==-1) {
error ("MatrixOrbital: open(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
if (tcgetattr(fd, &portset)==-1) {
error ("MatrixOrbital: tcgetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
cfmakeraw(&portset);
cfsetospeed(&portset, Speed);
if (tcsetattr(fd, TCSANOW, &portset)==-1) {
error ("MatrixOrbital: tcsetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
return fd;