Skip to content

Commit 104ee13

Browse files
authored
Merge pull request #71824 from ahoppen/ahoppen/abort
[SourceKit] Exit the `SourceKitService` process on a SIGTERM
2 parents 22e9424 + 6d23bf6 commit 104ee13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/SourceKit/tools/sourcekitd/bin/XPC/Service/XPCService.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/Support/Path.h"
2727
#include "llvm/Support/Threading.h"
2828

29+
#include <csignal>
2930
#include <xpc/xpc.h>
3031

3132
using namespace SourceKit;
@@ -385,6 +386,7 @@ static void fatal_error_handler(void *user_data, const char *reason,
385386
}
386387

387388
int main(int argc, const char *argv[]) {
389+
std::signal(SIGTERM, SIG_DFL);
388390
llvm::install_fatal_error_handler(fatal_error_handler, 0);
389391
sourcekitd::enableLogging("sourcekit-serv");
390392
sourcekitd_set_uid_handlers(

0 commit comments

Comments
 (0)