diff options
Diffstat (limited to '')
-rw-r--r-- | SIN.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: SIN.c,v 1.6 2001/02/13 09:00:13 reinelt Exp $ +/* $Id: SIN.c,v 1.7 2001/04/27 05:04:57 reinelt Exp $ * * driver for SIN router displays * @@ -20,6 +20,12 @@ * * * $Log: SIN.c,v $ + * Revision 1.7 2001/04/27 05:04:57 reinelt + * + * replaced OPEN_MAX with sysconf() + * replaced mktemp() with mkstemp() + * unlock serial port if open() fails + * * Revision 1.6 2001/02/13 09:00:13 reinelt * * prepared framework for GPO's (general purpose outputs) @@ -96,16 +102,19 @@ static int SIN_open (void) fd = open(Port, O_RDWR | O_NOCTTY | O_NDELAY); if (fd==-1) { error ("SIN: open(%s) failed: %s", Port, strerror(errno)); + unlock_port(Port); return -1; } if (tcgetattr(fd, &portset)==-1) { error ("SIN: tcgetattr(%s) failed: %s", Port, strerror(errno)); + unlock_port(Port); return -1; } cfmakeraw(&portset); cfsetospeed(&portset, B9600); if (tcsetattr(fd, TCSANOW, &portset)==-1) { error ("SIN: tcsetattr(%s) failed: %s", Port, strerror(errno)); + unlock_port(Port); return -1; } return fd; |