Fix warnings, adjust style.

Reviewed by:	bdrewery, dim, emaste (as part of D11504)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-07-10 08:10:45 +00:00
parent ae77193109
commit 7bd5b9f365

View File

@ -57,92 +57,103 @@ void _rtld_atfork_post(int *);
#pragma weak _rtld_error
void
_rtld_error(const char *fmt, ...)
_rtld_error(const char *fmt __unused, ...)
{
}
#pragma weak dladdr
int
dladdr(const void *addr, Dl_info *dlip)
dladdr(const void *addr __unused, Dl_info *dlip __unused)
{
_rtld_error(sorry);
return 0;
return (0);
}
#pragma weak dlclose
int
dlclose(void *handle)
dlclose(void *handle __unused)
{
_rtld_error(sorry);
return -1;
return (-1);
}
#pragma weak dlerror
char *
dlerror(void)
{
return sorry;
return (sorry);
}
#pragma weak dllockinit
void
dllockinit(void *context,
void *(*lock_create)(void *context),
void (*rlock_acquire)(void *lock),
void (*wlock_acquire)(void *lock),
void (*lock_release)(void *lock),
void (*lock_destroy)(void *lock),
void (*context_destroy)(void *context))
void *(*lock_create)(void *context) __unused,
void (*rlock_acquire)(void *lock) __unused,
void (*wlock_acquire)(void *lock) __unused,
void (*lock_release)(void *lock) __unused,
void (*lock_destroy)(void *lock) __unused,
void (*context_destroy)(void *context) __unused)
{
if (context_destroy != NULL)
context_destroy(context);
}
#pragma weak dlopen
void *
dlopen(const char *name, int mode)
dlopen(const char *name __unused, int mode __unused)
{
_rtld_error(sorry);
return NULL;
return (NULL);
}
#pragma weak dlsym
void *
dlsym(void * __restrict handle, const char * __restrict name)
dlsym(void * __restrict handle __unused, const char * __restrict name __unused)
{
_rtld_error(sorry);
return NULL;
return (NULL);
}
#pragma weak dlfunc
dlfunc_t
dlfunc(void * __restrict handle, const char * __restrict name)
dlfunc(void * __restrict handle __unused, const char * __restrict name __unused)
{
_rtld_error(sorry);
return NULL;
return (NULL);
}
#pragma weak dlvsym
void *
dlvsym(void * __restrict handle, const char * __restrict name,
const char * __restrict version)
dlvsym(void * __restrict handle __unused, const char * __restrict name __unused,
const char * __restrict version __unused)
{
_rtld_error(sorry);
return NULL;
return (NULL);
}
#pragma weak dlinfo
int
dlinfo(void * __restrict handle, int request, void * __restrict p)
dlinfo(void * __restrict handle __unused, int request __unused,
void * __restrict p __unused)
{
_rtld_error(sorry);
return 0;
return (0);
}
#pragma weak _rtld_thread_init
void
_rtld_thread_init(void * li)
_rtld_thread_init(void *li __unused)
{
_rtld_error(sorry);
}
@ -184,8 +195,8 @@ dl_init_phdr_info(void)
#pragma weak dl_iterate_phdr
int
dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *),
void *data)
dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused,
void *data __unused)
{
__init_elf_aux_vector();
@ -197,28 +208,29 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *),
#pragma weak fdlopen
void *
fdlopen(int fd, int mode)
fdlopen(int fd __unused, int mode __unused)
{
_rtld_error(sorry);
return NULL;
return (NULL);
}
#pragma weak _rtld_atfork_pre
void
_rtld_atfork_pre(int *locks)
_rtld_atfork_pre(int *locks __unused)
{
}
#pragma weak _rtld_atfork_post
void
_rtld_atfork_post(int *locks)
_rtld_atfork_post(int *locks __unused)
{
}
#pragma weak _rtld_addr_phdr
int
_rtld_addr_phdr(const void *addr, struct dl_phdr_info *phdr_info)
_rtld_addr_phdr(const void *addr __unused,
struct dl_phdr_info *phdr_info_a __unused)
{
return (0);
@ -234,7 +246,7 @@ _rtld_get_stack_prot(void)
#pragma weak _rtld_is_dlopened
int
_rtld_is_dlopened(void *arg)
_rtld_is_dlopened(void *arg __unused)
{
return (0);