File tree 2 files changed +16
-0
lines changed
CoreServices/WindowServer
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 31
31
#define FINISH (x ) ret=(x); goto __finish;
32
32
33
33
extern int optopt ;
34
+ static jmp_buf jb;
34
35
35
36
void *machSvcLoop (void *arg) {
36
37
WindowServer *ws = (__bridge WindowServer *)arg;
44
45
[ws processKernelQueue ];
45
46
}
46
47
48
+ static void crashHandler (int sig) {
49
+ longjmp (jb, SIGSEGV);
50
+ }
51
+
47
52
int main (int argc, const char *argv[]) {
48
53
NSAutoreleasePool *pool = [NSAutoreleasePool new ];
49
54
int logLevel = WS_ERROR;
@@ -82,6 +87,11 @@ int main(int argc, const char *argv[]) {
82
87
signal (SIGTHR, SIG_IGN);
83
88
signal (SIGLIBRT, SIG_IGN);
84
89
90
+ if (setjmp (jb) != 0 )
91
+ goto __finish; // sighandler must have caught something - get out
92
+
93
+ signal (SIGSEGV, crashHandler);
94
+
85
95
/* Drop our controlling terminal - we're gonna switch */
86
96
/* This is the recommended but sucky way. Using TIOCNOTTY isn't working */
87
97
pid_t pid = fork ();
Original file line number Diff line number Diff line change @@ -161,6 +161,12 @@ uninstall-completion :
161
161
clean :
162
162
$(RM ) * .o $(PROGRAMS ) core
163
163
164
+ # Targets for etcupdate.sh
165
+ installetc :
166
+ buildetc :
167
+ installconfig :
168
+
169
+ # Targets for buildworld
164
170
includes :
165
171
distribute :
166
172
$(MAKE ) -C ${.CURDIR} DESTDIR=${OBJTOP} /release/dist/base/ install
You can’t perform that action at this time.
0 commit comments