diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-01-15 14:40:50 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-01-23 15:08:23 +0100 |
commit | 86e4d8ead48501f00466d685c157eaa0921d96a8 (patch) | |
tree | ed4355457cc0aacb94a8ed1b3e6462df2584e065 /erts/emulator/beam | |
parent | 1520bca342e8433089841d2c79d3d862d06479e5 (diff) | |
download | otp-86e4d8ead48501f00466d685c157eaa0921d96a8.tar.gz otp-86e4d8ead48501f00466d685c157eaa0921d96a8.tar.bz2 otp-86e4d8ead48501f00466d685c157eaa0921d96a8.zip |
erts: Check driver version before assigning callback
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/io.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 2ac27f024e..012a7d1a4b 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -7349,6 +7349,8 @@ no_stop_select_callback(ErlDrvEvent event, void* private) erts_send_error_to_logger_nogl(dsbufp); } +#define IS_DRIVER_VERSION_GE(DE,MAJOR,MINOR) \ + ((DE)->major_version >= (MAJOR) && (DE)->minor_version >= (MINOR)) static int init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle) @@ -7396,7 +7398,7 @@ init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle) drv->timeout = de->timeout ? de->timeout : no_timeout_callback; drv->ready_async = de->ready_async; drv->process_exit = de->process_exit; - drv->emergency_close = de->emergency_close; + drv->emergency_close = IS_DRIVER_VERSION_GE(de,3,2) ? de->emergency_close : NULL; if (de->stop_select) drv->stop_select = de->stop_select; else @@ -7415,6 +7417,8 @@ init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle) } } +#undef IS_DRIVER_VERSION_GE + void erts_destroy_driver(erts_driver_t *drv) { |