aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-08-14 03:47:40 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-08-14 03:47:40 +0000
commitc655744a2364a4eb8f3a827931f22997783236dc (patch)
tree033346d6bb263c1d3f6a5d04bb5038e239a871d1
parent8277ebb1dc89486eb27e35138943b408a4587157 (diff)
downloadlcd4linux-c655744a2364a4eb8f3a827931f22997783236dc.tar.gz
[lcd4linux @ 2003-08-14 03:47:40 by reinelt]
remove PID file if driver initialisation fails git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@213 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--cfg.c9
-rw-r--r--lcd4linux.c6
2 files changed, 11 insertions, 4 deletions
diff --git a/cfg.c b/cfg.c
index 06841a6..6fd6e07 100644
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.13 2003/02/22 07:53:10 reinelt Exp $
+/* $Id: cfg.c,v 1.14 2003/08/14 03:47:40 reinelt Exp $
*
* config file stuff
*
@@ -20,6 +20,9 @@
*
*
* $Log: cfg.c,v $
+ * Revision 1.14 2003/08/14 03:47:40 reinelt
+ * remove PID file if driver initialisation fails
+ *
* Revision 1.13 2003/02/22 07:53:10 reinelt
* cfg_get(key,defval)
*
@@ -273,13 +276,13 @@ int cfg_read (char *file)
if (check_cfg_file(file) == -1) {
error("config file '%s' is insecure, aborting", file);
- exit(2);
+ return -1;
}
stream=fopen (file, "r");
if (stream==NULL) {
error ("open(%s) failed: %s", file, strerror(errno));
- return-1;
+ return -1;
}
if (Config_File) free (Config_File);
diff --git a/lcd4linux.c b/lcd4linux.c
index 6a357f7..ee44cb5 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.41 2003/08/08 08:05:23 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.42 2003/08/14 03:47:40 reinelt Exp $
*
* LCD4Linux
*
@@ -20,6 +20,9 @@
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.42 2003/08/14 03:47:40 reinelt
+ * remove PID file if driver initialisation fails
+ *
* Revision 1.41 2003/08/08 08:05:23 reinelt
* added PID file handling
*
@@ -447,6 +450,7 @@ int main (int argc, char *argv[])
debug ("initializing driver %s", driver);
if (lcd_init(driver)==-1) {
+ pid_exit(PIDFILE);
exit (1);
}