summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-26 16:50:24 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-26 16:50:48 +1100
commitc81d2ae3c9a4f9b5d2291563f141bb10d64cd650 (patch)
tree24cdc8aa052e94add3cd4923b8d6ff7bf6db9885
parentaf807758e8d98ea53f58b2bae8f00b83074cfdec (diff)
downloadsamba-c81d2ae3c9a4f9b5d2291563f141bb10d64cd650.tar.gz
samba-c81d2ae3c9a4f9b5d2291563f141bb10d64cd650.tar.bz2
samba-c81d2ae3c9a4f9b5d2291563f141bb10d64cd650.zip
libreplace: strerror_r() is needed by heimdal on solaris8
-rw-r--r--lib/replace/libreplace.m42
-rw-r--r--lib/replace/replace.c8
-rw-r--r--lib/replace/replace.h5
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 8b7a56ecb7..6da209db8a 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -104,7 +104,7 @@ AC_CHECK_HEADERS(sys/mount.h mntent.h)
AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(unix.h)
-AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
+AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r)
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf)
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index e4b97a8913..6a325400f4 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -747,3 +747,11 @@ char *rep_get_current_dir_name(void)
return strdup(p);
}
#endif
+
+#ifndef HAVE_STRERROR_R
+char *rep_strerror_r(int errnum, char *buf, size_t buflen)
+{
+ strncpy(buf, strerror(errnum), buflen);
+ return buf;
+}
+#endif
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index cd73e65bea..9eb6604c96 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -512,6 +512,11 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
char *rep_get_current_dir_name(void);
#endif
+#ifndef HAVE_STRERROR_R
+#define strerror_r rep_strerror_r
+char *rep_strerror_r(int errnum, char *buf, size_t buflen);
+#endif
+
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif