示例#1
0
void patch_on_load_success(const char *rewritten_name, const char *orig_name)
{
   if (!(opts & OPT_DEBUG)) {
      return;
   }

   if (last_orig_name)
      spindle_free(last_orig_name);

   last_rewritten_name = (char *) rewritten_name;
   last_orig_name = spindle_strdup(orig_name);
   debug_printf2("Patching link map %s -> %s\n", rewritten_name, orig_name);
}
示例#2
0
文件: client.c 项目: hpc/Spindle
static int fetch_from_cache(const char *name, char **newname)
{
   int result;
   char *result_name;
   result = shmcache_lookup_or_add(name, &result_name);
   if (result == -1)
      return 0;

   debug_printf2("Shared cache has mapping from %s (%p) to %s (%p)\n", name, name,
                 (result_name == in_progress) ? "[IN PROGRESS]" :
                 (result_name ? result_name : "[NOT PRESENT]"),
                 result_name);
   if (result_name == in_progress) {
      debug_printf("Waiting for update to %s\n", name);
      result = shmcache_waitfor_update(name, &result_name);
      if (result == -1) {
         debug_printf("Entry for %s deleted while waiting for update\n", name);
         return 0;
      }
   }
   
   *newname = result_name ? spindle_strdup(result_name) : NULL;
   return 1;
}