diff --git a/Autoupdate/main.m b/Autoupdate/main.m index 96645bca..51636ed4 100644 --- a/Autoupdate/main.m +++ b/Autoupdate/main.m @@ -28,7 +28,11 @@ int main(int __unused argc, const char __unused *argv[]) dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue()); dispatch_source_set_event_handler(sigtermSource, ^{ - [appInstaller cleanupAndExitWithStatus:SIGTERM error:nil]; + // Don't clear the update directory because the installer may be in middle of installing an update + // We still need to set an event handler for receiving SIGTERM though, otherwise our job may not terminate + // (This is also recommended from the developer documentation). + // Simply exit with SIGTERM if we recieve this signal + exit(SIGTERM); }); dispatch_resume(sigtermSource);