Project

General

Profile

Actions

Backport #7746

closed

Backport NSGetEnviron()/setproctitle.c fix for macosx

Added by docwhat (Christian Höltje) about 11 years ago. Updated about 11 years ago.

Status:
Closed
[ruby-core:51713]

Description

The fix for issue #6576 should be back ported to 1.9.3 as well. Without it you cannot build shared ruby libraries that work reliably. An example of this breakage is compiling something that uses the embedded library like vim; it crashes the instance vim tries to use ruby.

Here's the patch needed:

diff --git a/missing/setproctitle.c b/missing/setproctitle.c
index 169ba8b..4dc6d03 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 */

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0