Menu

#1 Reload doesn't work on OS X

open
nobody
MudBot-Core (1)
5
2007-01-15
2007-01-15
psaindon
No

Reload does not work properly as-is on OS X. MudBot acts as if everything goes properly, but changes made to the modules are not incorporated into the running server--the old code is still executed.

The problem is that OS X does not fully implement the dlfcn.h functions, and dlclose does not work the way it does on other implementations. It's a known (although somewhat obscure) problem that you cannot unload and later reload a dylib with the same name. It's OS level and hopefully will be fixed in the future, but from what I've seen on the apple developers lists, isn't high priority.

What can be done is to replace the dylibs with bundles and use dyld.h instead of dlfcn. I've attached a diff patch that uses #if blocks to change the functions used by darwin systems, properly allowing reload to work on OS X.

Discussion

  • psaindon

    psaindon - 2007-01-15

    Patch to fix reload on OS X systems

     
  • psaindon

    psaindon - 2007-01-24

    Alternative version of patch (Might work better with "patch")

     
  • psaindon

    psaindon - 2007-01-24

    Logged In: YES
    user_id=1692166
    Originator: YES

    File Added: MacModPatch.diff

     
  • Andrei Vasiliu

    Andrei Vasiliu - 2007-02-07

    Logged In: YES
    user_id=1262293
    Originator: NO

    Wow. Been looking for ages trying to learn how to handle dylibs... The patch is amazing, many thanks!

     

Log in to post a comment.