pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:8:   # include "global.h"   # include "interpret.h"   # include "constants.h"   # include "pike_error.h"   # include "module.h"   # include "stralloc.h"   # include "pike_macros.h"   # include "main.h"   # include "constants.h"    - RCSID("$Id: dynamic_load.c,v 1.56 2001/09/18 22:59:56 hubbe Exp $"); + RCSID("$Id: dynamic_load.c,v 1.57 2001/11/26 14:54:07 grubba Exp $");      #else /* TESTING */      #include <stdio.h>      #endif /* !TESTING */      #ifdef HAVE_ERRNO_H   #include <errno.h>   #endif /* HAVE_ERRNO_H */
pike.git/src/dynamic_load.c:478:         #endif /* NO_PIKE_GUTS */      #ifdef CREATE_MAIN   #include <stdio.h>      int main()   {    void *module,*fun; -  dlinit(); +  if (!dlinit()) { +  fprintf(stderr, "dlinit() failed.\n"); +  exit(1); +  }    module=dlopen("./myconftest.so",RTLD_NOW);    if(!module)    {    fprintf(stderr,"Failed to link myconftest.so: %s\n",dlerror());    exit(1);    }    fun=dlsym(module,"testfunc");    if(!fun) fun=dlsym(module,"_testfunc");    if(!fun)    {    fprintf(stderr,"Failed to find function testfunc: %s\n",dlerror());    exit(1);    }    fprintf(stderr,"Calling testfunc\n");    ((void (*)(void))fun)();    fprintf(stderr,"testfunc returned!\n");    exit(1);   }   #endif /* CREATE_MAIN */