]> git.saurik.com Git - cycript.git/blobdiff - Trampoline.t.cpp
Got true JS booleans working in GNUstep.
[cycript.git] / Trampoline.t.cpp
index 8689df34bf74bbddc71375e95968a1d251aaf83c..e56f350cbc72749c34abb35bfb4e4fbf7e486703 100644 (file)
@@ -13,13 +13,15 @@ extern "C" void Start(Baton *baton) {
     baton->pthread_create(&thread, NULL, &Routine, baton);
 
     void *result;
-    baton->pthread_detach(thread);
+    baton->pthread_join(thread, &result);
 
     baton->thread_terminate(baton->mach_thread_self());
 }
 
 void *Routine(void *arg) {
     Baton *baton(reinterpret_cast<Baton *>(arg));
-    baton->dlopen(baton->library, RTLD_LAZY | RTLD_GLOBAL);
+    void *handle(baton->dlopen(baton->library, RTLD_LAZY | RTLD_LOCAL));
+    void (*HandleServer)(pid_t) = reinterpret_cast<void (*)(pid_t)>(baton->dlsym(handle, "CYHandleServer"));
+    HandleServer(baton->pid);
     return arg;
 }