From: Jim Meyering Date: Sun, 28 Jun 2015 17:35:04 +0000 (-0700) Subject: maint: stdbuf.c: avoid the OS X putenv function X-Git-Tag: v8.24~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f303fb6bbb6a924ab47a5c0d855ef27cb234347f;p=thirdparty%2Fcoreutils.git 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 --- 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)