diff options
author | Lukas Larsson <[email protected]> | 2016-08-17 12:03:44 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-08-17 12:03:44 +0200 |
commit | 69c270561a81d1fbdc2b15b5160c4d590ce2ff3d (patch) | |
tree | 755b6f1b6ff63463f975fcb14fded6234314f43a /lib/kernel/src/os.erl | |
parent | 650d0d075dfddf1bc3ebfa2cb9357d8311fd9645 (diff) | |
parent | 7b1cda1f97cd3ec91e7111b22aeffa3b5a6812f1 (diff) | |
download | otp-69c270561a81d1fbdc2b15b5160c4d590ce2ff3d.tar.gz otp-69c270561a81d1fbdc2b15b5160c4d590ce2ff3d.tar.bz2 otp-69c270561a81d1fbdc2b15b5160c4d590ce2ff3d.zip |
Merge branch 'maint'
* maint:
Updated OTP version
Prepare release
erts: Make sure to flush potential exit message
Diffstat (limited to 'lib/kernel/src/os.erl')
-rw-r--r-- | lib/kernel/src/os.erl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl index 81b70a7fee..05bbf1069e 100644 --- a/lib/kernel/src/os.erl +++ b/lib/kernel/src/os.erl @@ -279,15 +279,11 @@ get_data(Port, MonRef, Eot, Sofar) -> Last -> Port ! {self(), close}, flush_until_closed(Port), + flush_exit(Port), iolist_to_binary([Sofar, Last]) end; {'DOWN', MonRef, _, _ , _} -> - receive - {'EXIT', Port, _} -> - ok - after 1 -> % force context switch - ok - end, + flush_exit(Port), iolist_to_binary(Sofar) end. @@ -307,3 +303,11 @@ flush_until_closed(Port) -> {Port, closed} -> true end. + +flush_exit(Port) -> + receive + {'EXIT', Port, _} -> + ok + after 1 -> % force context switch + ok + end. |