From b62c1a22b30ac0108280fe2ba99254f605623972 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 7 Oct 2018 12:28:46 +0000 Subject: 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 --- mjit_worker.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mjit_worker.c') 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); } -- cgit v1.2.3