aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2006-04-22 21:30:48 +0000
committerAvuton Olrich <avuton@gmail.com>2006-04-22 21:30:48 +0000
commit3accf44add6471c5e5890e53bed8b95b6eb0b573 (patch)
tree5d383352ccbacfda440a2581e737055f1edf3ed6 /src/main.c
parentd6d2ca7be8468b5c2072b3c9b0be011ab897b884 (diff)
downloadmpd-3accf44add6471c5e5890e53bed8b95b6eb0b573.tar.gz
mpd-3accf44add6471c5e5890e53bed8b95b6eb0b573.tar.xz
mpd-3accf44add6471c5e5890e53bed8b95b6eb0b573.zip
Solaris is reported to not have a setenv() thus
breaking compilation. This fixes that problem with a macro that emulates setenv() with putenv(). git-svn-id: https://svn.musicpd.org/mpd/trunk@4097 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2f0bf870a..d0e64a27e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -67,6 +67,18 @@ typedef struct _Options {
int updateDB;
} Options;
+/* Solaris has been reported to have no setenv
+ * putenv() will automatically overwrite, so
+ * the overwrite macro will go unused
+ */
+#ifndef setenv
+#define setenv(name,value,overwrite) { \
+ char * tmp = NULL; \
+ sprintf(tmp,"%s=%s",name,value); \
+ putenv(tmp); \
+}
+#endif /* setenv */
+
void usage(char * argv[]) {
ERROR("usage:\n");
ERROR(" %s [options] <conf file>\n",argv[0]);