aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/sys_interrupt.c
diff options
context:
space:
mode:
authorJan Kloetzke <[email protected]>2012-07-31 21:08:31 +0200
committerJan Kloetzke <[email protected]>2012-07-31 21:21:49 +0200
commit03985084e42e262bac1b7c48a97c31db97348f1d (patch)
tree73ba2066f08aa478d48cc836e107ea7102329f9c /erts/emulator/sys/win32/sys_interrupt.c
parent92eb89bd630e822cfc93a07dad7d6c7a25f45d63 (diff)
downloadotp-03985084e42e262bac1b7c48a97c31db97348f1d.tar.gz
otp-03985084e42e262bac1b7c48a97c31db97348f1d.tar.bz2
otp-03985084e42e262bac1b7c48a97c31db97348f1d.zip
erlsrv: gracefully stop emulator on Windows shutdown
Windows will send the SERVICE_CONTROL_SHUTDOWN event to the service control handler when shutting down the system. Instead of ignoring the event, erlsrv will now invoke the stop action. Likewise, the Erlang emulator (and it's port drivers) must not quit upon reception of the CTRL_SHUTDOWN_EVENT event in the console control handler.
Diffstat (limited to 'erts/emulator/sys/win32/sys_interrupt.c')
-rw-r--r--erts/emulator/sys/win32/sys_interrupt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c
index 347c31053b..a507a19480 100644
--- a/erts/emulator/sys/win32/sys_interrupt.c
+++ b/erts/emulator/sys/win32/sys_interrupt.c
@@ -75,11 +75,11 @@ BOOL WINAPI ctrl_handler_ignore_break(DWORD dwCtrlType)
return TRUE;
break;
case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
if (nohup)
return TRUE;
/* else pour through... */
case CTRL_CLOSE_EVENT:
- case CTRL_SHUTDOWN_EVENT:
erl_exit(0, "");
break;
}
@@ -127,11 +127,11 @@ BOOL WINAPI ctrl_handler(DWORD dwCtrlType)
SetEvent(erts_sys_break_event);
break;
case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
if (nohup)
return TRUE;
/* else pour through... */
case CTRL_CLOSE_EVENT:
- case CTRL_SHUTDOWN_EVENT:
erl_exit(0, "");
break;
}