Permalink
Browse files

Yield meaningful result for old NIF callers

  • Loading branch information...
1 parent 3cd7751 commit cfc9ea3ac3cfcc854729f4840f145072d0d1a520 @krestenkrab krestenkrab committed Oct 4, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 jnif/jnif_sys.cc
View
@@ -11,6 +11,13 @@ static JavaVM *jvm;
void enif_system_info(ErlNifSysInfo* info, size_t si_size)
{
+ if (sizeof(*info) >= si_size) {
+ memset(info, 0, si_size);
+ info->driver_major_version = ERL_DRV_EXTENDED_MAJOR_VERSION;
+ info->driver_minor_version = ERL_DRV_EXTENDED_MINOR_VERSION;
+ return;
+ }
+
JNIEnv *je;
if (jvm->AttachCurrentThreadAsDaemon((void**)&je, NULL) == JNI_OK) {

0 comments on commit cfc9ea3

Please sign in to comment.