aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/sys.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-10-02 18:44:03 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-10-15 20:49:43 +0200
commit6aa87d58b756ef65650ee793ad4ece8add7b70fb (patch)
treee40745a989254631a2f921942ea74ffb76a4337a /erts/emulator/sys/win32/sys.c
parent952db27ba0a5b87a2a47f3a7034a9bf92e3651e5 (diff)
downloadotp-6aa87d58b756ef65650ee793ad4ece8add7b70fb.tar.gz
otp-6aa87d58b756ef65650ee793ad4ece8add7b70fb.tar.bz2
otp-6aa87d58b756ef65650ee793ad4ece8add7b70fb.zip
erts, heart: Ensure erl_crash.dump is written
When a crash dump is about to be written and we have heartbeat enabled on a system. We need time to write it before heart explicitly kills the beam.
Diffstat (limited to 'erts/emulator/sys/win32/sys.c')
-rwxr-xr-xerts/emulator/sys/win32/sys.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 6894d682e7..c5664d8e8a 100755
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -258,8 +258,22 @@ void erl_sys_args(int* argc, char** argv)
void
erts_sys_prepare_crash_dump(void)
{
+ Port *heart_port;
+ Eterm heap[3];
+ Eterm *hp = heap;
+ Eterm list = NIL;
+
+ heart_port = erts_get_heart_port();
+
+ if (heart_port) {
+
+ list = CONS(hp, make_small(8), list); hp += 2;
+
+ /* send to heart port, CMD = 8, i.e. prepare crash dump =o */
+ erts_write_to_port(NIL, heart_port, list);
+ }
+
/* Windows - free file descriptors are hopefully available */
- return;
}
static void