Skip to content

Commit 097a577

Browse files
committed
Start segv handler in WS. Fix dmidecode targets for basepkg build
1 parent eded48a commit 097a577

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CoreServices/WindowServer/main.m

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define FINISH(x) ret=(x); goto __finish;
3232

3333
extern int optopt;
34+
static jmp_buf jb;
3435

3536
void *machSvcLoop(void *arg) {
3637
WindowServer *ws = (__bridge WindowServer *)arg;
@@ -44,6 +45,10 @@
4445
[ws processKernelQueue];
4546
}
4647

48+
static void crashHandler(int sig) {
49+
longjmp(jb, SIGSEGV);
50+
}
51+
4752
int main(int argc, const char *argv[]) {
4853
NSAutoreleasePool *pool = [NSAutoreleasePool new];
4954
int logLevel = WS_ERROR;
@@ -82,6 +87,11 @@ int main(int argc, const char *argv[]) {
8287
signal(SIGTHR, SIG_IGN);
8388
signal(SIGLIBRT, SIG_IGN);
8489

90+
if(setjmp(jb) != 0)
91+
goto __finish; // sighandler must have caught something - get out
92+
93+
signal(SIGSEGV, crashHandler);
94+
8595
/* Drop our controlling terminal - we're gonna switch */
8696
/* This is the recommended but sucky way. Using TIOCNOTTY isn't working */
8797
pid_t pid = fork();

gnu/usr.bin/dmidecode/Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ uninstall-completion :
161161
clean :
162162
$(RM) *.o $(PROGRAMS) core
163163

164+
# Targets for etcupdate.sh
165+
installetc:
166+
buildetc:
167+
installconfig:
168+
169+
# Targets for buildworld
164170
includes:
165171
distribute:
166172
$(MAKE) -C ${.CURDIR} DESTDIR=${OBJTOP}/release/dist/base/ install

0 commit comments

Comments
 (0)