Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6613c18e
Commit
6613c18e
authored
Nov 27, 2011
by
Charles-François Natali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13415: Test in configure if unsetenv() has a return value or not.
parent
6d47db31
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
333 additions
and
310 deletions
+333
-310
Modules/posixmodule.c
Modules/posixmodule.c
+6
-0
configure
configure
+315
-310
configure.in
configure.in
+9
-0
pyconfig.h.in
pyconfig.h.in
+3
-0
No files found.
Modules/posixmodule.c
View file @
6613c18e
...
...
@@ -6185,18 +6185,24 @@ posix_unsetenv(PyObject *self, PyObject *args)
{
PyObject
*
os1
;
char
*
s1
;
#ifndef HAVE_BROKEN_UNSETENV
int
err
;
#endif
if
(
!
PyArg_ParseTuple
(
args
,
"O&:unsetenv"
,
PyUnicode_FSConverter
,
&
os1
))
return
NULL
;
s1
=
PyBytes_AsString
(
os1
);
#ifdef HAVE_BROKEN_UNSETENV
unsetenv
(
s1
);
#else
err
=
unsetenv
(
s1
);
if
(
err
)
{
Py_DECREF
(
os1
);
return
posix_error
();
}
#endif
/* Remove the key from posix_putenv_garbage;
* this will cause it to be collected. This has to
...
...
configure
View file @
6613c18e
This diff is collapsed.
Click to expand it.
configure.in
View file @
6613c18e
...
...
@@ -2696,6 +2696,15 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for broken unsetenv)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
]], [[int res = unsetenv("DUMMY")]])],
[AC_MSG_RESULT(no)],
[AC_DEFINE(HAVE_BROKEN_UNSETENV, 1, Define if `unsetenv` does not return an int.)
AC_MSG_RESULT(yes)
])
dnl check for true
AC_CHECK_PROGS(TRUE, true, /bin/true)
...
...
pyconfig.h.in
View file @
6613c18e
...
...
@@ -98,6 +98,9 @@
/* define to 1 if your sem_getvalue is broken. */
#undef HAVE_BROKEN_SEM_GETVALUE
/* Define if `unsetenv` does not return an int. */
#undef HAVE_BROKEN_UNSETENV
/* Define this if you have the type _Bool. */
#undef HAVE_C99_BOOL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment