summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 05:13:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 05:13:40 +0000
commit4be94836bd5eb2e2815c5b04c5427e05e9dc98d8 (patch)
treefc1cb28b3f6223370129df6185235773aac39b4d /missing
parent10d2b5ec466d321ab7e4662088c9e2d285266c04 (diff)
merge revision(s) 36151: [Backport #7746]
* missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of environ on Darwin for namespace cleanness, same as [ruby-core:00537]. [ruby-core:45615] [Bug #6576] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/setproctitle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/missing/setproctitle.c b/missing/setproctitle.c
index 169ba8bcd2..d35e70d534 100644
--- a/missing/setproctitle.c
+++ b/missing/setproctitle.c
@@ -48,6 +48,12 @@
#endif
#include <string.h>
+#if defined(__APPLE__)
+#include <crt_externs.h>
+#undef environ
+#define environ (*_NSGetEnviron())
+#endif
+
#define SPT_NONE 0 /* don't use it at all */
#define SPT_PSTAT 1 /* use pstat(PSTAT_SETCMD, ...) */
#define SPT_REUSEARGV 2 /* cover argv with title information */