1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Modernize dlopen interface code for FreeBSD and OpenBSD.

Remove the hard-wired assumption that __mips__ (and only __mips__) lacks
dlopen in FreeBSD and OpenBSD.  This assumption is outdated at least for
OpenBSD, as per report from an anonymous 9.1 tester.  We can perfectly well
use HAVE_DLOPEN instead to decide which code to use.

Some other cosmetic adjustments to make freebsd.c, netbsd.c, and openbsd.c
exactly alike.
This commit is contained in:
Tom Lane
2011-04-07 15:14:51 -04:00
parent 5d3853a7fa
commit d5b9c9f733
3 changed files with 13 additions and 13 deletions

View File

@ -78,10 +78,10 @@ BSD44_derived_dlsym(void *handle, const char *name)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return NULL;
#elif defined(__ELF__)
return dlsym(handle, name);
#else
void *vp;
#ifndef __ELF__
char buf[BUFSIZ];
if (*name != '_')
@ -89,6 +89,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
#endif /* !__ELF__ */
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);