summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/replace/replace.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-23 23:20:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:38 -0500
commit47fb506da2f1ff00f538ec30120c816ad0eeab37 (patch)
tree09bceda524eee7fc7c02e5e12ffd8135b6f2f372 /source4/lib/ldb/replace/replace.c
parent48c7cfcb749f2df1500339c1046854721f8a1a7e (diff)
downloadsamba-47fb506da2f1ff00f538ec30120c816ad0eeab37.tar.gz
samba-47fb506da2f1ff00f538ec30120c816ad0eeab37.tar.bz2
samba-47fb506da2f1ff00f538ec30120c816ad0eeab37.zip
r17762: HPUX needs setenv
(This used to be commit 535c96f1e7639071d34ea47a88181d861c3a3038)
Diffstat (limited to 'source4/lib/ldb/replace/replace.c')
-rw-r--r--source4/lib/ldb/replace/replace.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/ldb/replace/replace.c b/source4/lib/ldb/replace/replace.c
index 2c2068f8f4..e2df7fe363 100644
--- a/source4/lib/ldb/replace/replace.c
+++ b/source4/lib/ldb/replace/replace.c
@@ -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