Changeset: e54cc7e9164a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e54cc7e9164a
Modified Files:
NT/monetdb_config.h.in
configure.ag
gdk/gdk_posix.c
monetdb5/extras/rapi/rapi.c
Branch: Nov2019
Log Message:
Use putenv instead of setenv.
Putenv is available on Windows, setenv isn't.
diffs (70 lines):
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -394,9 +394,6 @@
/* Define if semtimedop exists */
/* #undef HAVE_SEMTIMEDOP */
-/* Define to 1 if you have the `setenv' function. */
-/* #undef HAVE_SETENV */
-
/* Define to 1 if you have the `setsid' function. */
/* #undef HAVE_SETSID */
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2427,7 +2427,6 @@ AC_CHECK_FUNCS([\
posix_fallocate \
posix_madvise \
putenv \
- setenv \
setsid \
shutdown \
sigaction \
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -63,30 +63,6 @@
#define O_CLOEXEC 0
#endif
-/* DDALERT: AIX4.X 64bits needs HAVE_SETENV==0 due to a AIX bug, but
- * it probably isn't detected so by configure */
-
-#ifndef HAVE_SETENV
-int
-setenv(const char *name, const char *value, int overwrite)
-{
- int ret = 0;
-
- if (overwrite || getenv(name) == NULL) {
- char *p = GDKmalloc(2 + strlen(name) + strlen(value));
-
- if (p == NULL)
- return -1;
- strcpy(p, name);
- strcat(p, "=");
- strcat(p, value);
- ret = putenv(p);
- /* GDKfree(p); LEAK INSERTED DUE TO SOME WEIRD CRASHES */
- }
- return ret;
-}
-#endif
-
/* Crude VM buffer management that keep a list of all memory mapped
* regions.
*
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -105,7 +105,7 @@ static char *RAPIinitialize(void) {
char *e;
// set R_HOME for packages etc. We know this from our configure script
- setenv("R_HOME", RHOME, TRUE);
+ putenv("R_HOME=" RHOME);
// set some command line arguments
{
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list