aboutsummaryrefslogtreecommitdiffstats
path: root/PalmPilot.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 /PalmPilot.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 'PalmPilot.c')
-rw-r--r--PalmPilot.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/PalmPilot.c b/PalmPilot.c
index 139d99c..66eeb0c 100644
--- a/PalmPilot.c
+++ b/PalmPilot.c
@@ -1,4 +1,4 @@
-/* $Id: PalmPilot.c,v 1.5 2001/03/16 16:40:17 ltoetsch Exp $
+/* $Id: PalmPilot.c,v 1.6 2001/04/27 05:04:57 reinelt Exp $
*
* driver for 3Com Palm Pilot
*
@@ -20,6 +20,12 @@
*
*
* $Log: PalmPilot.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/03/16 16:40:17 ltoetsch
* implemented time bar
*
@@ -98,16 +104,19 @@ static int Palm_open (void)
fd = open(Port, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd==-1) {
error ("PalmPilot: open(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
if (tcgetattr(fd, &portset)==-1) {
error ("PalmPilot: tcgetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
cfmakeraw(&portset);
cfsetospeed(&portset, Speed);
if (tcsetattr(fd, TCSANOW, &portset)==-1) {
error ("PalmPilot: tcsetattr(%s) failed: %s", Port, strerror(errno));
+ unlock_port(Port);
return -1;
}
return fd;