From 98741e0392dd159d8f4039d570a79e1e3b90736b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 12 Apr 2008 17:34:48 +0000 Subject: Fix for bug #7100: when rendering on solaris, pressing esc could kill the process. Some time ago SIGVTALRM was replaced with SIGALRM to solve issues on linux, but this signal can kill the process on solaris, so now it uses SIGVTALRM again there. --- source/blender/src/renderwin.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index 4510e72e659..52404989897 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -1018,7 +1018,7 @@ static void end_test_break_callback() } #else -/* all other OS's support signal(SIGVTALRM) */ +/* all other OS's support signal(SIGVTALRM/SIGALRM) */ /* XXX The ESC problem: some unix users reported that ESC doesn't cancel * renders anymore. Most complaints came from linux, but it's not @@ -1029,7 +1029,10 @@ static void end_test_break_callback() * fixes the problem, at least while we investigate better. * * ITIMER_REAL (SIGALRM): timer that counts real system time - * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process */ + * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process + * + * Addendum: now SIGVTALRM is used on Solaris again, because SIGALRM can + * kill the process there! */ /* POSIX: this function goes in the signal() callback */ static void interruptESC(int sig) @@ -1038,7 +1041,11 @@ static void interruptESC(int sig) if(G.afbreek==0) G.afbreek= 2; /* code for read queue */ /* call again, timer was reset */ +#ifdef __sun + signal(SIGVTALRM, interruptESC); +#else signal(SIGALRM, interruptESC); +#endif } /* POSIX: initialize timer and signal */ @@ -1053,8 +1060,13 @@ static void init_test_break_callback() tmevalue.it_value.tv_sec = 0; tmevalue.it_value.tv_usec = 10000; +#ifdef __sun + signal(SIGVTALRM, interruptESC); + setitimer(ITIMER_VIRTUAL, &tmevalue, 0); +#else signal(SIGALRM, interruptESC); setitimer(ITIMER_REAL, &tmevalue, 0); +#endif } /* POSIX: stop timer and callback */ @@ -1064,9 +1076,13 @@ static void end_test_break_callback() memset(&tmevalue, 0, sizeof(struct itimerval)); +#ifdef __sun + setitimer(ITIMER_VIRTUAL, &tmevalue, 0); + signal(SIGVTALRM, SIG_IGN); +#else setitimer(ITIMER_REAL, &tmevalue, 0); signal(SIGALRM, SIG_IGN); - +#endif } -- cgit v1.2.3