diff options
author | Björn Gustavsson <[email protected]> | 2011-12-07 12:27:57 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-12-09 11:46:26 +0100 |
commit | 0d24b1cc87cb72b1e1737aec55abf87914e2fc82 (patch) | |
tree | f09fc1e2f22efefbb43f717922205f67abeca954 | |
parent | 261fc9e444187f30e0b1afe69adbafc715124ba1 (diff) | |
download | otp-0d24b1cc87cb72b1e1737aec55abf87914e2fc82.tar.gz otp-0d24b1cc87cb72b1e1737aec55abf87914e2fc82.tar.bz2 otp-0d24b1cc87cb72b1e1737aec55abf87914e2fc82.zip |
Remove support for old drivers without ERL_DRV_EXTENDED_MARKER
Because of the extensive changes in the driver API (and especially
the change of return types for callbacks such as 'control'), we
can no longer allow drivers without version numbers.
-rw-r--r-- | erts/emulator/beam/erl_bif_ddll.c | 18 | ||||
-rw-r--r-- | erts/emulator/beam/io.c | 24 |
2 files changed, 7 insertions, 35 deletions
diff --git a/erts/emulator/beam/erl_bif_ddll.c b/erts/emulator/beam/erl_bif_ddll.c index b2d5722e9b..37d540b41b 100644 --- a/erts/emulator/beam/erl_bif_ddll.c +++ b/erts/emulator/beam/erl_bif_ddll.c @@ -1580,24 +1580,6 @@ static int do_load_driver_entry(DE_Handle *dh, char *path, char *name) } switch (dp->extended_marker) { - case 0: - /* - * This may be an old driver that has been recompiled. If so, - * at least the fields that existed in extended driver version - * 1.0 should be zero. If not, a it is a bad driver. We cannot - * be completely certain that this is a valid driver but this is - * the best we can do with old drivers... - */ - if (dp->major_version != 0 - || dp->minor_version != 0 - || dp->driver_flags != 0 - || dp->handle2 != NULL - || dp->process_exit != NULL) { - /* Old driver; needs to be recompiled... */ - res = ERL_DE_LOAD_ERROR_INCORRECT_VERSION; - goto error; - } - break; case ERL_DRV_EXTENDED_MARKER: if (ERL_DRV_EXTENDED_MAJOR_VERSION != dp->major_version || ERL_DRV_EXTENDED_MINOR_VERSION < dp->minor_version) { diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 1749cac66c..49cd0e5f53 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -4814,16 +4814,11 @@ static int init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle) { drv->name = de->driver_name; - if (de->extended_marker == ERL_DRV_EXTENDED_MARKER) { - drv->version.major = de->major_version; - drv->version.minor = de->minor_version; - drv->flags = de->driver_flags; - } - else { - drv->version.major = 0; - drv->version.minor = 0; - drv->flags = 0; - } + ASSERT(de->extended_marker == ERL_DRV_EXTENDED_MARKER); + ASSERT(de->major_version >= 2); + drv->version.major = de->major_version; + drv->version.minor = de->minor_version; + drv->flags = de->driver_flags; drv->handle = handle; #ifdef ERTS_SMP if (drv->flags & ERL_DRV_FLAG_USE_PORT_LOCKING) @@ -4856,13 +4851,8 @@ init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle) drv->ready_output = de->ready_output ? de->ready_output : no_ready_output_callback; drv->timeout = de->timeout ? de->timeout : no_timeout_callback; drv->ready_async = de->ready_async; - if (de->extended_marker == ERL_DRV_EXTENDED_MARKER) - drv->process_exit = de->process_exit; - else - drv->process_exit = NULL; - if ((de->major_version >= 2 - || (de->major_version == 1 && de->minor_version >= 3)/*R13A*/) - && de->stop_select) + drv->process_exit = de->process_exit; + if (de->stop_select) drv->stop_select = de->stop_select; else drv->stop_select = no_stop_select_callback; |