diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-07 12:28:46 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-07 12:28:46 +0000 |
commit | b62c1a22b30ac0108280fe2ba99254f605623972 (patch) | |
tree | 467e0126a62e7c5fcbedafb066a212683c42da31 | |
parent | 686a12a6a486e514288afe187fce512d603f36c3 (diff) | |
download | ruby-b62c1a22b30ac0108280fe2ba99254f605623972.tar.gz |
mjit_worker.c: print warning if FreeLibrary fails
because somehow AppVeyor fails to remove so file by Permission Deined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | mjit_worker.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mjit_worker.c b/mjit_worker.c index a706b5a5f0..c66d90f61e 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -107,7 +107,7 @@ #define dlopen(name,flag) ((void*)LoadLibrary(name)) #define dlerror() strerror(rb_w32_map_errno(GetLastError())) #define dlsym(handle,name) ((void*)GetProcAddress((handle),(name))) -#define dlclose(handle) (FreeLibrary(handle)) +#define dlclose(handle) (!FreeLibrary(handle)) #define RTLD_NOW -1 #define waitpid(pid,stat_loc,options) (WaitForSingleObject((HANDLE)(pid), INFINITE), GetExitCodeProcess((HANDLE)(pid), (LPDWORD)(stat_loc)), (pid)) @@ -423,8 +423,9 @@ free_unit(struct rb_mjit_unit *unit) unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; unit->iseq->body->jit_unit = NULL; } - if (unit->handle) /* handle is NULL if it's in queue */ - dlclose(unit->handle); + if (unit->handle && dlclose(unit->handle)) { /* handle is NULL if it's in queue */ + mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror()); + } clean_object_files(unit); free(unit); } |