aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-19 21:40:42 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-19 21:40:42 +0000
commit8275cee2387ff946cab355b47ecb270cfa94d0e2 (patch)
tree511c36b34bf501da5c2e6efa15f4ea7a44eaee0f
parent63e2848d646d4882377443ba32a0803b390ccec4 (diff)
fix the build of eagi-test on Solaris in combination with astmm
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@13630 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--agi/Makefile2
-rw-r--r--strcompat.c9
2 files changed, 4 insertions, 7 deletions
diff --git a/agi/Makefile b/agi/Makefile
index a2f3bee05..e24587720 100644
--- a/agi/Makefile
+++ b/agi/Makefile
@@ -13,7 +13,7 @@
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
-CFLAGS+=
+CFLAGS+=-DNO_AST_MM
LIBS=
ifeq ($(OSARCH),SunOS)
diff --git a/strcompat.c b/strcompat.c
index 8c9916d23..93a6b0c2b 100644
--- a/strcompat.c
+++ b/strcompat.c
@@ -33,21 +33,18 @@ char* strsep(char** str, const char* delims)
int setenv(const char *name, const char *value, int overwrite)
{
unsigned char *buf;
- int buflen, ret;
+ int buflen;
buflen = strlen(name) + strlen(value) + 2;
- if ((buf = malloc(buflen)) == NULL)
+ if (!(buf = alloca(buflen)))
return -1;
if (!overwrite && getenv(name))
return 0;
snprintf(buf, buflen, "%s=%s", name, value);
- ret = putenv(buf);
- free(buf);
-
- return ret;
+ return putenv(buf);
}
void unsetenv(const char *name)