aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorherp <herp@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-02-26 00:33:37 +0000
committerherp <herp@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-02-26 00:33:37 +0000
commit62115d60d25ac6d50962feba114b5cc4566cadd6 (patch)
treef86f14285a53a10a2d45f23f3257c8fb10dee9b4
parent70aa88c6dab864084ac6e61fbabc67fe2e85685d (diff)
downloadlcd4linux-62115d60d25ac6d50962feba114b5cc4566cadd6.tar.gz
[lcd4linux @ 2001-02-26 00:33:37 by herp]
fixed X11 signal handler git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@89 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--XWindow.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/XWindow.c b/XWindow.c
index a40dbe9..59f2303 100644
--- a/XWindow.c
+++ b/XWindow.c
@@ -1,4 +1,4 @@
-/* $Id: XWindow.c,v 1.22 2001/02/13 09:00:13 reinelt Exp $
+/* $Id: XWindow.c,v 1.23 2001/02/26 00:33:37 herp Exp $
*
* X11 Driver for LCD4Linux
*
@@ -20,6 +20,9 @@
*
*
* $Log: XWindow.c,v $
+ * Revision 1.23 2001/02/26 00:33:37 herp
+ * fixed X11 signal handler
+ *
* Revision 1.22 2001/02/13 09:00:13 reinelt
*
* prepared framework for GPO's (general purpose outputs)
@@ -99,6 +102,7 @@
/*
+ * Mon Feb 26 02:07:52 MET 2001 fixed sighandler
* Tue Apr 4 02:37:38 MET 2000 fixed a bug that caused pixelerrors under h/load
* Sun Apr 2 22:07:10 MET 2000 fixed a bug that occasionally caused Xlib error
* Sun Apr 2 01:32:48 MET 2000 geometric correction (too many pixelgaps)
@@ -120,6 +124,7 @@
#include <string.h>
#include <errno.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
@@ -197,8 +202,29 @@ static void shmcleanup() {
}
static void quit_updater() {
- if (async_updater_pid>1)
- kill(async_updater_pid,15);
+int i;
+ if (async_updater_pid>1) {
+ i=async_updater_pid;
+ async_updater_pid=1;
+ kill(i,9);
+ waitpid(i,&i,0);
+ }
+}
+
+static void sig_updater(int sig) {
+ kill(ppid,sig);
+ exit(0);
+}
+
+static void init_signals() {
+unsigned int ignsig=(1<<SIGBUS)|(1<<SIGFPE)|(1<<SIGSEGV)|
+ (1<<SIGTSTP)|(1<<SIGCHLD)|(1<<SIGCONT)|
+ (1<<SIGTTIN)|(1<<SIGWINCH);
+int i;
+ for(i=0;i<NSIG;i++)
+ if (((1<<i)&ignsig)==0)
+ signal(i,sig_updater);
+
}
static int init_shm(int nbytes,unsigned char **buf) {
@@ -244,6 +270,7 @@ union semun semun;
default:
break;
}
+ signal(SIGCHLD,quit_updater);
atexit(quit_updater);
return 0;
}
@@ -349,6 +376,7 @@ char *s;
if (pix_init(rows,cols,xres,yres)==-1) return -1;
if (init_x(rows,cols,xres,yres)==-1) return -1;
+ init_signals();
if (init_shm(rows*cols*xres*yres,&BackupLCDpixmap)==-1) return -1;
memset(BackupLCDpixmap,0xff,rows*yres*cols*xres);
if (init_thread(rows*cols*xres*yres)==-1) return -1;
@@ -406,11 +434,10 @@ int x,y;
}
int xlcdquit(void) {
+ error("xlcdquit");
semcleanup();
shmcleanup();
- if (ppid!=getpid())
- // FIXME: kill(ppid,nsig);
- kill(ppid,SIGTERM);
+ quit_updater();
return 0;
}
a5a161e002a4dbfb27a4d79e616c9850c29ea0&follow=1'>[lcd4linux @ 2003-09-01 07:07:03 by reinelt]reinelt8-402/+13825 shared liblcd4linux git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@231 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-09-01[lcd4linux @ 2003-09-01 04:09:34 by reinelt]reinelt9-28/+127 icons nearly finished, but MatrixOrbital only git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@230 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-24[lcd4linux @ 2003-08-24 05:28:31 by reinelt]reinelt1-119/+156 ChangeLog git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@229 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-24[lcd4linux @ 2003-08-24 05:17:58 by reinelt]reinelt25-131/+217 liblcd4linux patch from Patrick Schemitz git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@228 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-24[lcd4linux @ 2003-08-24 04:31:56 by reinelt]reinelt6-11/+154 icon.c icon.h added git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@227 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-22[lcd4linux @ 2003-08-22 03:45:08 by reinelt]reinelt3-8/+25 bug in parallel port code fixed, more icons stuff git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@226 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-20[lcd4linux @ 2003-08-20 05:26:43 by reinelt]reinelt1-9/+11 small bug in bar compaction fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@225 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-19[lcd4linux @ 2003-08-19 05:23:55 by reinelt]reinelt2-62/+123 HD44780 dual-controller patch from Jesse Brook Kovach git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@224 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-19[lcd4linux @ 2003-08-19 04:28:41 by reinelt]reinelt4-19/+42 more Icon stuff, minor glitches fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@223 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-17[lcd4linux @ 2003-08-17 16:37:39 by reinelt]reinelt5-23/+77 more icon framework git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@222 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-17[lcd4linux @ 2003-08-17 12:11:58 by reinelt]reinelt6-27/+118 framework for icons prepared git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@221 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-17[lcd4linux @ 2003-08-17 08:25:30 by reinelt]reinelt6-46/+185 preparations for liblcd4linux; minor bugs in SIN.c and Skeleton.c git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@220 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2003-08-17[lcd4linux @ 2003-08-17 06:57:04 by reinelt]reinelt5-544/+325 complete rewrite of the Crystalfontz driver git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@219 3ae390bd-cb1e-0410-b409-cd5a39f66f1f