1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

r17762: HPUX needs setenv

(This used to be commit 535c96f1e7)
This commit is contained in:
Andrew Tridgell 2006-08-23 23:20:50 +00:00 committed by Gerald (Jerry) Carter
parent 48c7cfcb74
commit 47fb506da2
2 changed files with 18 additions and 1 deletions

View File

@ -5,7 +5,7 @@ AC_CHECK_TYPE(uint64_t, unsigned long long)
AC_CHECK_TYPE(comparison_fn_t,
[AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])])
AC_CHECK_FUNCS(strerror timegm strnlen)
AC_CHECK_FUNCS(strerror timegm strnlen setenv)
AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
AC_HAVE_DECL(errno, [#include <errno.h>])

View File

@ -67,3 +67,20 @@
}
#endif
#ifndef HAVE_SETENV
int setenv(const char *name, const char *value, int overwrite)
{
char *p = NULL;
int ret = -1;
asprintf(&p, "%s=%s", name, value);
if (overwrite || getenv(name)) {
if (p) ret = putenv(p);
} else {
ret = 0;
}
return ret;
}
#endif