Changeset 89907 in vbox
- Timestamp:
- Jun 24, 2021 11:23:21 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r89222 r89907 58 58 #endif 59 59 60 //#define VBOX_WITH_SAVESTATE_ON_SIGNAL 61 #ifdef VBOX_WITH_SAVESTATE_ON_SIGNAL 60 #if !defined(RT_OS_WINDOWS) 62 61 #include <signal.h> 63 62 static void HandleSignal(int sig); … … 396 395 VBOX_LISTENER_DECLARE(ConsoleEventListenerImpl) 397 396 398 #if def VBOX_WITH_SAVESTATE_ON_SIGNAL397 #if !defined(RT_OS_WINDOWS) 399 398 static void 400 399 HandleSignal(int sig) … … 404 403 g_fTerminateFE = true; 405 404 } 406 #endif /* VBOX_WITH_SAVESTATE_ON_SIGNAL*/405 #endif /* !RT_OS_WINDOWS */ 407 406 408 407 //////////////////////////////////////////////////////////////////////////////// … … 983 982 /* 984 983 * Simplified version of showProgress() borrowed from VBoxManage. 984 * Note that machine power up/down operations are not cancelable, so 985 * we don't bother checking for signals. 985 986 */ 986 987 HRESULT … … 1623 1624 Log(("VBoxHeadless: Powering up the machine...\n")); 1624 1625 1625 ComPtr <IProgress> progress; 1626 if (!fPaused) 1627 CHECK_ERROR_BREAK(console, PowerUp(progress.asOutParam())); 1628 else 1629 CHECK_ERROR_BREAK(console, PowerUpPaused(progress.asOutParam())); 1630 1631 rc = showProgress(progress); 1632 if (FAILED(rc)) 1633 { 1634 com::ProgressErrorInfo info(progress); 1635 if (info.isBasicAvailable()) 1636 { 1637 RTPrintf("Error: failed to start machine. Error message: %ls\n", info.getText().raw()); 1638 } 1639 else 1640 { 1641 RTPrintf("Error: failed to start machine. No error message available!\n"); 1642 } 1643 break; 1644 } 1645 1646 #ifdef VBOX_WITH_SAVESTATE_ON_SIGNAL 1626 1627 /** 1628 * @todo We should probably install handlers earlier so that 1629 * we can undo any temporary settings we do above in case of 1630 * an early signal and use RAII to ensure proper cleanup. 1631 */ 1632 #if !defined(RT_OS_WINDOWS) 1647 1633 signal(SIGPIPE, SIG_IGN); 1648 1634 signal(SIGTTOU, SIG_IGN); … … 1656 1642 sigaction(SIGUSR1, &sa, NULL); 1657 1643 sigaction(SIGUSR2, &sa, NULL); 1658 #endif 1659 1660 #ifdef RT_OS_WINDOWS 1644 #else /* RT_OS_WINDOWS */ 1661 1645 /* 1662 1646 * Register windows console signal handler to react to Ctrl-C, 1663 * Ctrl-Break, Close .1647 * Ctrl-Break, Close, non-interactive session termination. 1664 1648 */ 1665 1649 ::SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); 1666 1650 #endif 1651 1652 1653 ComPtr <IProgress> progress; 1654 if (!fPaused) 1655 CHECK_ERROR_BREAK(console, PowerUp(progress.asOutParam())); 1656 else 1657 CHECK_ERROR_BREAK(console, PowerUpPaused(progress.asOutParam())); 1658 1659 rc = showProgress(progress); 1660 if (FAILED(rc)) 1661 { 1662 com::ProgressErrorInfo info(progress); 1663 if (info.isBasicAvailable()) 1664 { 1665 RTPrintf("Error: failed to start machine. Error message: %ls\n", info.getText().raw()); 1666 } 1667 else 1668 { 1669 RTPrintf("Error: failed to start machine. No error message available!\n"); 1670 } 1671 break; 1672 } 1673 1674 #ifdef RT_OS_WINDOWS 1667 1675 /* 1668 1676 * Spawn windows message pump to monitor session events.
Note:
See TracChangeset
for help on using the changeset viewer.