diff options
author | Micael Karlberg <[email protected]> | 2019-03-04 17:07:23 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-03-05 09:50:22 +0100 |
commit | 49eb95319e878832cb3d6aa51a63d08d6b1b36b7 (patch) | |
tree | db26f27549deb8871c632a67f0cd12740134184a /erts/emulator/nifs/common | |
parent | c3d9459c6310157a577a557bad870ec27ae86d46 (diff) | |
download | otp-49eb95319e878832cb3d6aa51a63d08d6b1b36b7.tar.gz otp-49eb95319e878832cb3d6aa51a63d08d6b1b36b7.tar.bz2 otp-49eb95319e878832cb3d6aa51a63d08d6b1b36b7.zip |
[socket] Make use of official monitor to term function
Remove own function to make monitor printable (was a hack)
and make use of the new enif_make_monitor_term instead.
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r-- | erts/emulator/nifs/common/socket_int.h | 1 | ||||
-rw-r--r-- | erts/emulator/nifs/common/socket_nif.c | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/erts/emulator/nifs/common/socket_int.h b/erts/emulator/nifs/common/socket_int.h index 5fe590fa7a..58e0645691 100644 --- a/erts/emulator/nifs/common/socket_int.h +++ b/erts/emulator/nifs/common/socket_int.h @@ -357,6 +357,7 @@ GLOBAL_ERROR_REASON_ATOM_DEFS #define MONP(S,E,D,P,M) esock_monitor((S), (E), (D), (P), (M)) #define DEMONP(S,E,D,M) esock_demonitor((S), (E), (D), (M)) #define MON_INIT(M) esock_monitor_init((M)) +#define MON2T(E, M) enif_make_monitor_term((E), (M)) // #define MON_COMP(M1, M2) esock_monitor_compare((M1), (M2)) #define COMPARE(A, B) enif_compare((A), (B)) diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c index cd51a5fcbd..2d8dc3c201 100644 --- a/erts/emulator/nifs/common/socket_nif.c +++ b/erts/emulator/nifs/common/socket_nif.c @@ -32,7 +32,7 @@ * * esock_dbg_printf("DEMONP", "[%d] %s: %T\r\n", * descP->sock, slogan, - * my_make_monitor_term(env, &monP->mon)); + * MON2T(env, &monP->mon)); * */ @@ -17310,12 +17310,6 @@ void cnt_dec(Uint32* cnt, Uint32 dec) #if !defined(__WIN32__) static -ERL_NIF_TERM my_make_monitor_term(ErlNifEnv* env, const ErlNifMonitor* mon) -{ - return ((ERL_NIF_TERM)&mon->data) + 2; -} - -static int esock_monitor(const char* slogan, ErlNifEnv* env, SocketDescriptor* descP, @@ -17858,7 +17852,7 @@ void socket_down(ErlNifEnv* env, "\r\n Descriptor: %d" "\r\n Monitor: %T" "\r\n", sres, pid, descP->sock, - my_make_monitor_term(env, mon)); + MON2T(env, mon)); } } else { |