summaryrefslogtreecommitdiffstats
path: root/src/glut/fbdev/fbdev.c
diff options
context:
space:
mode:
authorSean D'Epagnier <[email protected]>2007-02-16 17:44:13 -0700
committerSean D'Epagnier <[email protected]>2007-02-16 17:44:13 -0700
commit7ae8f388cf81c187f0cbfcc4997c93b28cf6c26a (patch)
tree9aaed85cca23cf3fecc00b562c20be5c41f3c8aa /src/glut/fbdev/fbdev.c
parente4c772bead57c0190f74f1fa43dd129e170567f7 (diff)
Commiting a few minor fixes to glut fbdev (segfault on a separate stack)
Updated all drivers that used the old _ac_ functions to use the new _vbo_ functions. I know this fixed the fbdev driver, it looks like it might fix some other drivers too.
Diffstat (limited to 'src/glut/fbdev/fbdev.c')
-rw-r--r--src/glut/fbdev/fbdev.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c
index 3b63cd70ea1..80237f5bc75 100644
--- a/src/glut/fbdev/fbdev.c
+++ b/src/glut/fbdev/fbdev.c
@@ -173,6 +173,9 @@ void glutInit (int *argcp, char **argv)
int RequiredWidth = 0, RequiredHeight;
char *fbdev;
+ stack_t stack;
+ struct sigaction sa;
+
/* parse out args */
for (i = 1; i < *argcp;) {
if (!strcmp(argv[i], "-geometry")) {
@@ -239,7 +242,19 @@ void glutInit (int *argcp, char **argv)
gettimeofday(&StartTime, 0);
atexit(Cleanup);
- signal(SIGSEGV, CrashHandler);
+ /* set up SIGSEGV to use alternate stack */
+ stack.ss_flags = 0;
+ stack.ss_size = SIGSTKSZ;
+ if(!(stack.ss_sp = malloc(SIGSTKSZ)))
+ sprintf(exiterror, "Failed to allocate alternate stack for SIGSEGV!\n");
+
+ sigaltstack(&stack, NULL);
+
+ sa.sa_handler = CrashHandler;
+ sa.sa_flags = SA_ONSTACK;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, NULL);
+
signal(SIGINT, CrashHandler);
signal(SIGTERM, CrashHandler);
signal(SIGABRT, CrashHandler);