git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Bug] wrapper.c uses unportable unsetenv

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Oct 29, 2021, 20:14 UTC
Message-ID
<012301d7cd01$90428960$b0c79c20$@nexbridge.com>

The unsetenv()/setenv(overwrite) calls are not 100% portable - as in not on all POSIX implementations. It breaks the build on some of the NonStop platforms. This will change in a year or two but I really don't want to fall behind on git releases.

This was introduced at 3540c71 but I was on vacation when it happened so did not catch it during reviews - my apologies for that.

Is it critical that this be called or can we #ifdef it away if it isn't supported for a build? The #if is exactly this:

wrapper.c@150
+ #if (_TANDEM_ARCH_ > 3 || (_TANDEM_ARCH_ == 3 && __L_Series_RVU >= 2010))
	if (setenv(name, value, overwrite))
		die_errno(_("could not setenv '%s'"), name ? name :
"(null)");
+ #endif
wrapper.c@154
+ #if (_TANDEM_ARCH_ > 3 || (_TANDEM_ARCH_ == 3 && __L_Series_RVU >= 2010))
	if (!unsetenv(name))
		die_errno(_("could not unsetenv '%s'"), name ? name :
"(null)");
+ #endif
-Randall
Next: Junio C Hamano
Message 1 of 7 in “[Bug] wrapper.c uses unportable unsetenv”
  1. rsbecker@nexbridge.comOct 29, 2021
  2. Junio C HamanoOct 29, 2021
  3. rsbecker@nexbridge.comOct 29, 2021
  4. rsbecker@nexbridge.comOct 29, 2021
  5. Junio C HamanoOct 29, 2021
  6. Johannes SchindelinOct 29, 2021
  7. Junio C HamanoOct 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.