pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:9:   #define CREATE_MAIN   #define NO_PIKE_GUTS   #endif      #ifndef NO_PIKE_INCLUDES   # include "global.h"   # include "interpret.h"   # include "constants.h"   # include "pike_error.h"   # include "pike_compiler.h" - # include "module.h" +    # include "stralloc.h"   # include "pike_macros.h"   # include "main.h"   # include "constants.h"   # include "lex.h"   # include "object.h"   # include "cyclic.h"      #else /* TESTING */   
pike.git/src/dynamic_load.c:480:    RTLD_NOW /*|RTLD_GLOBAL*/ );    }       if(!module)    {    struct object *err_obj = fast_clone_object(module_load_error_program);   #define LOADERR_STRUCT(OBJ) \    ((struct module_load_error_struct *) (err_obj->storage + module_load_error_offset))       const char *err = dlerror(); +  struct pike_string *str;    if (err) {    if (err[strlen (err) - 1] == '\n')    push_string (make_shared_binary_string (err, strlen (err) - 1));    else    push_text (err);    }    else    push_static_text ("Unknown reason");       add_ref (LOADERR_STRUCT (err_obj)->path = Pike_sp[-args - 1].u.string); -  add_ref (LOADERR_STRUCT (err_obj)->reason = Pike_sp[-1].u.string); +  add_ref (LOADERR_STRUCT (err_obj)->reason = str = Pike_sp[-1].u.string); +  pop_stack();    -  if (Pike_sp[-args].u.string->len < 1024) { -  throw_error_object (err_obj, "load_module", Pike_sp - args - 1, args, +  if (str->len < 1024) { +  throw_error_object (err_obj, "load_module", args,    "load_module(\"%s\") failed: %s\n", -  module_name->str, Pike_sp[-1].u.string->str); +  module_name->str, str->str);    } else { -  throw_error_object (err_obj, "load_module", Pike_sp - args - 1, args, -  "load_module() failed: %s\n", -  Pike_sp[-1].u.string->str); +  throw_error_object (err_obj, "load_module", args, +  "load_module(\"%s\") failed.\n", +  module_name->str);    }    }      #ifdef PIKE_DEBUG    {    struct module_list *mp;    for (mp = dynamic_module_list; mp; mp = mp->next)    if (mp->module == module && mp->module_prog) {    fprintf(stderr, "load_module(): Module loaded twice:\n"    "Old name: %s\n"