aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/win32/port_entry.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/etc/win32/port_entry.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/etc/win32/port_entry.c')
-rw-r--r--erts/etc/win32/port_entry.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/erts/etc/win32/port_entry.c b/erts/etc/win32/port_entry.c
index 49b5ad2f34..9c3e750cbc 100644
--- a/erts/etc/win32/port_entry.c
+++ b/erts/etc/win32/port_entry.c
@@ -45,6 +45,8 @@ extern void mainCRTStartup(void);
BOOL WINAPI erl_port_default_handler(DWORD ctrl){
if(ctrl == CTRL_LOGOFF_EVENT)
return TRUE;
+ if(ctrl == CTRL_SHUTDOWN_EVENT)
+ return TRUE;
return FALSE;
}