mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
heimdal_build: Try again to sort out the strerror_r mess
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
d90b709ebb
commit
dda48146a2
@ -785,7 +785,7 @@ char *rep_get_current_dir_name(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRERROR_R) && !defined(strerror_r)
|
||||
#ifndef HAVE_STRERROR_R
|
||||
int rep_strerror_r(int errnum, char *buf, size_t buflen)
|
||||
{
|
||||
char *s = strerror(errnum);
|
||||
|
@ -570,7 +570,8 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
|
||||
char *rep_get_current_dir_name(void);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRERROR_R) && !defined(strerror_r)
|
||||
#ifndef HAVE_STRERROR_R
|
||||
#define strerror_r rep_strerror_r
|
||||
int rep_strerror_r(int errnum, char *buf, size_t buflen);
|
||||
#endif
|
||||
|
||||
|
@ -123,14 +123,6 @@
|
||||
#define HAVE_SETEUID
|
||||
#endif
|
||||
|
||||
/* force the use of the libreplace strerror_r */
|
||||
#ifndef HAVE_STRERROR_R
|
||||
#define HAVE_STRERROR_R
|
||||
#endif
|
||||
#ifndef STRERROR_R_PROTO_COMPATIBLE
|
||||
#define STRERROR_R_PROTO_COMPATIBLE
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DIRFD
|
||||
#ifdef HAVE_DIR_DD_FD
|
||||
#define dirfd(x) ((x)->dd_fd)
|
||||
|
@ -408,6 +408,7 @@ if not bld.CONFIG_SET('USING_SYSTEM_ROKEN'):
|
||||
lib/roken/resolve.c
|
||||
lib/roken/socket.c
|
||||
lib/roken/roken_gethostby.c
|
||||
lib/roken/strerror_r.c
|
||||
'''
|
||||
|
||||
HEIMDAL_LIBRARY('roken',
|
||||
|
@ -28,6 +28,13 @@ conf.CHECK_FUNCS('''atexit cgetent getprogname setprogname gethostname
|
||||
strptime strsep strsep_copy strtok_r strupr swab umask uname unsetenv
|
||||
closefrom err warn errx warnx flock writev''')
|
||||
|
||||
if conf.CHECK_FUNCS('strerror_r'):
|
||||
# Check if strerror_r is BSD compatible (default GNU implementation is not what Heimdal expects)
|
||||
conf.CHECK_CODE('int strerror_r(int errnum, char *buf, size_t buflen);',
|
||||
'STRERROR_R_PROTO_COMPATIBLE',
|
||||
headers='string.h', addmain=False, link=False,
|
||||
msg="Checking for XSI (rather than GNU) prototype for strerror_r")
|
||||
|
||||
conf.CHECK_FUNCS_IN('hstrerror', 'resolv socket nsl', checklibc=True)
|
||||
conf.CHECK_FUNCS_IN('''getnameinfo sendmsg socket getipnodebyname gethostent gethostent_r
|
||||
sethostent endhostent getipnodebyaddr freehostent gethostbyname
|
||||
|
Loading…
Reference in New Issue
Block a user