aboutsummaryrefslogtreecommitdiffstats
path: root/drv_generic_serial.c
diff options
context:
space:
mode:
authorreinelt <>2004-03-03 03:47:04 +0000
committerreinelt <>2004-03-03 03:47:04 +0000
commit9b7d2e2732d586f86c3458053a20120b79936621 (patch)
tree723676ea31fe0615b4d0caca1491e5a21fe85c7a /drv_generic_serial.c
parent27334b5cb11a8c3462cffda31aa7e8180561d78f (diff)
downloadlcd4linux-9b7d2e2732d586f86c3458053a20120b79936621.tar.gz
[lcd4linux @ 2004-03-03 03:47:04 by reinelt]
big patch from Martin Hejl: - use qprintf() where appropriate - save CPU cycles on gettimeofday() - add quit() functions to free allocated memory - fixed lots of memory leaks
Diffstat (limited to 'drv_generic_serial.c')
-rw-r--r--drv_generic_serial.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drv_generic_serial.c b/drv_generic_serial.c
index 46c524d..a4cb312 100644
--- a/drv_generic_serial.c
+++ b/drv_generic_serial.c
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_serial.c,v 1.6 2004/02/14 11:56:17 reinelt Exp $
+/* $Id: drv_generic_serial.c,v 1.7 2004/03/03 03:47:04 reinelt Exp $
*
* generic driver helper for serial and usbserial displays
*
@@ -23,6 +23,13 @@
*
*
* $Log: drv_generic_serial.c,v $
+ * Revision 1.7 2004/03/03 03:47:04 reinelt
+ * big patch from Martin Hejl:
+ * - use qprintf() where appropriate
+ * - save CPU cycles on gettimeofday()
+ * - add quit() functions to free allocated memory
+ * - fixed lots of memory leaks
+ *
* Revision 1.6 2004/02/14 11:56:17 reinelt
* M50530 driver ported
* changed lots of 'char' to 'unsigned char'
@@ -94,6 +101,7 @@
#include "debug.h"
#include "cfg.h"
#include "drv_generic_serial.h"
+#include "qprintf.h"
static char *Driver;
@@ -127,8 +135,8 @@ pid_t drv_generic_serial_lock_port (char *Port)
*p='_';
}
- snprintf(lockfile, sizeof(lockfile), LOCK, port);
- snprintf(tempfile, sizeof(tempfile), LOCK, "TMP.XXXXXX");
+ qprintf(lockfile, sizeof(lockfile), LOCK, port);
+ qprintf(tempfile, sizeof(tempfile), LOCK, "TMP.XXXXXX");
free (port);
@@ -222,7 +230,7 @@ static pid_t drv_generic_serial_unlock_port (char *Port)
*p='_';
}
- snprintf(lockfile, sizeof(lockfile), LOCK, port);
+ qprintf(lockfile, sizeof(lockfile), LOCK, port);
unlink (lockfile);
free (port);
@@ -353,6 +361,7 @@ int drv_generic_serial_close (void)
info ("%s: closing port %s", Driver, Port);
close (Device);
drv_generic_serial_unlock_port(Port);
+ free(Port);
return 0;
}