Changeset 28599 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Apr 22, 2010 2:48:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r27634 r28599 30 30 #endif 31 31 #include <errno.h> 32 32 #ifndef RT_OS_WINDOWS 33 # include <signal.h> 34 #endif 35 36 #include "product-generated.h" 33 37 #include <iprt/asm.h> 34 38 #include <iprt/buildconfig.h> … … 133 137 RTPrintf(" --enable-%-10s Enables the %s service. (default)\n", g_aServices[j].pDesc->pszName, g_aServices[j].pDesc->pszName); 134 138 RTPrintf(" --disable-%-9s Disables the %s service.\n", g_aServices[j].pDesc->pszName, g_aServices[j].pDesc->pszName); 135 RTPrintf("%s", g_aServices[j].pDesc->pszOptions); 139 if (g_aServices[j].pDesc->pszOptions) 140 RTPrintf("%s", g_aServices[j].pDesc->pszOptions); 136 141 } 137 142 RTPrintf("\n" 138 " Copyright (C) 2009 Sun Microsystems, Inc.\n");143 " Copyright (C) 2009-" VBOX_C_YEAR " " VBOX_VENDOR "\n"); 139 144 140 145 return 1; … … 385 390 VBoxServiceVerbose(2, "Stopping services returned: rc=%Rrc\n", rc); 386 391 return rc; 392 } 393 394 /** 395 * Signal handler for properly shutting down the services on Posix platforms. 396 */ 397 static void VBoxServiceSignalHandler(int /* sig */) 398 { 399 VBoxServiceVerbose(2, "VBoxServiceSignalHandler hit\n"); 400 /* Flag the main service that we want to terminate */ 401 g_fShutdown = 1; 402 unsigned iMain = VBoxServiceGetStartedServices(); 403 /* Get the main thread out of the waiting loop */ 404 g_aServices[iMain].pDesc->pfnStop(); 387 405 } 388 406 … … 603 621 * Start the service, enter the main threads run loop and stop them again when it returns. 604 622 */ 623 #ifndef RT_OS_WINDOWS 624 struct sigaction sa; 625 sa.sa_handler = VBoxServiceSignalHandler; 626 sigemptyset(&sa.sa_mask); 627 sa.sa_flags = 0; 628 sigaction(SIGHUP, &sa, NULL); 629 sigaction(SIGINT, &sa, NULL); 630 sigaction(SIGQUIT, &sa, NULL); 631 sigaction(SIGABRT, &sa, NULL); 632 sigaction(SIGTERM, &sa, NULL); 633 #endif 605 634 rc = VBoxServiceStartServices(iMain); 606 635 VBoxServiceStopServices();
Note:
See TracChangeset
for help on using the changeset viewer.