summaryrefslogtreecommitdiff
path: root/ext/DynaLoader
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.co.uk>2013-11-15 11:30:50 +1100
committerTony Cook <tony@develop-help.com>2014-01-16 15:37:13 +1100
commitf48d8d9daf0f92cffbbef9a80e5f2c4d260c320c (patch)
treed625e8e5c63fa243b28b72f0154eb9ab252c847c /ext/DynaLoader
parent817bb5726ea19a5cf60d1aa249e44880d3267fab (diff)
downloadperl-f48d8d9daf0f92cffbbef9a80e5f2c4d260c320c.tar.gz
fix some linuxisms and RETVAL warnings from xsubpp
Original patch by Alan, modified by Tony Cook to remove unused return types.
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r--ext/DynaLoader/dl_freemint.xs31
1 files changed, 15 insertions, 16 deletions
diff --git a/ext/DynaLoader/dl_freemint.xs b/ext/DynaLoader/dl_freemint.xs
index cab9e90a0d..6970a760e2 100644
--- a/ext/DynaLoader/dl_freemint.xs
+++ b/ext/DynaLoader/dl_freemint.xs
@@ -65,19 +65,15 @@ dl_private_init(pTHX)
dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
dl_require_symbols = get_av("DynaLoader::dl_require_symbols", GV_ADDMULTI);
-#ifdef __linux__
- dlderr = dld_init("/proc/self/exe");
+ dlderr = dld_init("/kern/self/exe");
if (dlderr) {
-#endif
dlderr = dld_init(dld_find_executable(PL_origargv[0]));
if (dlderr) {
char *msg = dld_strerror(dlderr);
- SaveError(aTHX_ "dld_init(%s) failed: %s", PL_origargv[0], msg);
+ SaveError(aTHX_ "dld_init(%s) failed: %s", dld_find_executable(PL_origargv[0]), msg);
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "%s", dl_last_error));
}
-#ifdef __linux__
}
-#endif
}
}
@@ -88,7 +84,7 @@ BOOT:
(void)dl_private_init();
-char *
+void
dl_load_file(filename, flags=0)
char * filename
int flags
@@ -97,7 +93,6 @@ dl_load_file(filename, flags=0)
GV *gv;
dMY_CXT;
CODE:
- RETVAL = filename;
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_croak(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
@@ -139,28 +134,31 @@ dl_load_file(filename, flags=0)
goto haverror;
}
}
- DLDEBUG(2,PerlIO_printf(Perl_debug_log, "libref=%s\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "libref=%s\n", filename));
haverror:
ST(0) = sv_newmortal() ;
if (dlderr == 0)
- sv_setiv(ST(0), PTR2IV(RETVAL));
+ sv_setiv(ST(0), PTR2IV(filename));
+ XSRETURN(1);
-void *
+void
dl_find_symbol(libhandle, symbolname)
void * libhandle
char * symbolname
+ PREINIT:
+ void *retv;
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
- RETVAL = (void *)dld_get_func(symbolname);
- /* if RETVAL==NULL we should try looking for a non-function symbol */
- DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref = %x\n", RETVAL));
+ retv = (void *)dld_get_func(symbolname);
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref = %x\n", (unsigned int)retv));
ST(0) = sv_newmortal() ;
- if (RETVAL == NULL)
+ if (retv == NULL)
SaveError(aTHX_ "dl_find_symbol: Unable to find '%s' symbol", symbolname) ;
else
- sv_setiv(ST(0), PTR2IV(RETVAL));
+ sv_setiv(ST(0), PTR2IV(retv));
+ XSRETURN(1);
void
@@ -191,6 +189,7 @@ dl_install_xsub(perl_name, symref, filename="$Package")
(void(*)(pTHX_ CV *))symref,
filename, NULL,
XS_DYNAMIC_FILENAME)));
+ XSRETURN(1);
char *
dl_error()