pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:1: Inside #if undefined(TESTING)
  #ifndef TESTING   # include "global.h"   # include "interpret.h"   # include "constants.h"   # include "error.h"   # include "module.h"   # include "stralloc.h"   # include "pike_macros.h"    - RCSID("$Id: dynamic_load.c,v 1.26 1998/04/17 00:15:01 grubba Exp $"); + RCSID("$Id: dynamic_load.c,v 1.27 1998/05/15 18:38:49 grubba Exp $");      #endif      #if !defined(HAVE_DLOPEN)      #if defined(HAVE_DLD_LINK) && defined(HAVE_DLD_GET_FUNC)   #define USE_DLD   #define HAVE_SOME_DLOPEN   #define EMULATE_DLOPEN   #else
pike.git/src/dynamic_load.c:161: Inside #if undefined(TESTING) and #if defined(HAVE_DLOPEN) || defined(USE_DLD)
   error("Bad argument 1 to load_module()\n");       module_name = sp[-args].u.string->str;       module=dlopen(module_name, RTLD_NOW);       if(!module)    {    const char *err = dlerror();    if(!err) err = "Unknown reason"; +  if (sp[-args].u.string->len < 1024) {    error("load_module(\"%s\") failed: %s\n",    sp[-args].u.string->str, err); -  +  } else { +  error("load_module() failed: %s\n", err);    } -  +  }       init=(modfun)dlsym(module, "pike_module_init");    if (!init) {    init=(modfun)dlsym(module, "_pike_module_init");    }    exit=(modfun)dlsym(module, "pike_module_exit");    if (!exit) {    exit=(modfun)dlsym(module, "_pike_module_exit");    }       if(!init || !exit)    {    dlclose(module);    -  error("Failed to initialize module \"%s\".\n", module_name); +  if (sizeof(module_name) < 1024) { +  error("Failed to initialize dynamic module \"%s\".\n", module_name); +  } else { +  error("Failed to initialize dynamic module.\n");    } -  +  }       new_module=ALLOC_STRUCT(module_list);    new_module->next=dynamic_module_list;    dynamic_module_list=new_module;    new_module->module=module;    new_module->init=init;    new_module->exit=exit;       pop_n_elems(args);    start_new_program();