Skip to content

Commit c3d21af

Browse files
committed
dl_dyld.xs should not create a mode variable only to ignore it
This unused variable dates back to when the file was first added. The code was structured as a static C wrapper emulating the dlopen() API with the native APIs, and then a copy of the existing XS code that called dlopen(). However, there is (and was) no need to keep it exactly this way, as the wrapper is only visible inside this file, meaning that it does not need to conform to any externally defined prototype.
1 parent 7aa33fb commit c3d21af

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

ext/DynaLoader/DynaLoader_pm.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ package DynaLoader;
9090
# [email protected], August 1994
9191
9292
BEGIN {
93-
our $VERSION = '1.52';
93+
our $VERSION = '1.53';
9494
}
9595
9696
# Note: in almost any other piece of code "our" would have been a better

ext/DynaLoader/dl_dyld.xs

+2-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void TranslateError
104104
sv_setpv(MY_CXT.x_dl_last_error, error);
105105
}
106106

107-
static char *dlopen(char *path, int mode /* mode is ignored */)
107+
static char *dlopen(char *path)
108108
{
109109
int dyld_result;
110110
NSObjectFileImage ofile;
@@ -159,13 +159,11 @@ void *
159159
dl_load_file(filename, flags=0)
160160
char * filename
161161
int flags
162-
PREINIT:
163-
int mode = 1;
164162
CODE:
165163
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
166164
if (flags & 0x01)
167165
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
168-
RETVAL = dlopen(filename, mode) ;
166+
RETVAL = dlopen(filename);
169167
DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
170168
ST(0) = sv_newmortal() ;
171169
if (RETVAL == NULL)

0 commit comments

Comments
 (0)