From f303fb6bbb6a924ab47a5c0d855ef27cb234347f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 28 Jun 2015 10:35:04 -0700 Subject: [PATCH] maint: stdbuf.c: avoid the OS X putenv function * bootstrap.conf (gnulib_modules): Add setenv, to make this module dependency explicit; setenv is also used by split. * src/stdbuf.c (set_LD_PRELOAD) [__APPLE__]: Use the OS X setenv function, rather than putenv, per that documentation: https://developer.apple.com/\ library/mac/documentation/Darwin/Reference/ManPages/man3/putenv.3.html --- bootstrap.conf | 1 + src/stdbuf.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 5b6ec58e50..67837b3f97 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -210,6 +210,7 @@ gnulib_modules=" savedir savewd selinux-at + setenv settime sig2str sigaction diff --git a/src/stdbuf.c b/src/stdbuf.c index fe4d773a76..116619d7a9 100644 --- a/src/stdbuf.c +++ b/src/stdbuf.c @@ -256,7 +256,7 @@ set_LD_PRELOAD (void) ret = putenv (LD_PRELOAD); #ifdef __APPLE__ if (ret == 0) - ret = putenv ("DYLD_FORCE_FLAT_NAMESPACE=y"); + ret = setenv ("DYLD_FORCE_FLAT_NAMESPACE", "y", 1); #endif if (ret != 0) -- 2.47.2