mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Second attempt to fix the ctermid_r/tmpnam_r warnings: define USE_CTERMID_R
and USE_TMPNAM_R at the top of the file and refer to them later; this catches a second reference to 'tmpnam_r' that I didn't spot first time around.
This commit is contained in:
parent
9217fcbb38
commit
b48bc17d10
1 changed files with 13 additions and 3 deletions
|
@ -274,6 +274,16 @@ extern int lstat Py_PROTO((const char *, struct stat *));
|
||||||
|
|
||||||
#endif /* UNION_WAIT */
|
#endif /* UNION_WAIT */
|
||||||
|
|
||||||
|
/* Don't use the "_r" form if we don't need it (also, won't have a
|
||||||
|
prototype for it, at least on Solaris -- maybe others as well?). */
|
||||||
|
#if defined(HAVE_CTERMID_R) && defined(WITH_THREAD)
|
||||||
|
#define USE_CTERMID_R
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_TMPNAM_R) && defined(WITH_THREAD)
|
||||||
|
#define USE_TMPNAM_R
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return a dictionary corresponding to the POSIX environment table */
|
/* Return a dictionary corresponding to the POSIX environment table */
|
||||||
|
|
||||||
#if !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
|
#if !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
|
||||||
|
@ -649,7 +659,7 @@ posix_ctermid(self, args)
|
||||||
if (!PyArg_ParseTuple(args, ":ctermid"))
|
if (!PyArg_ParseTuple(args, ":ctermid"))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#if defined(HAVE_CTERMID_R) && defined(WITH_THREAD)
|
#ifdef USE_CTERMID_R
|
||||||
ret = ctermid_r(buffer);
|
ret = ctermid_r(buffer);
|
||||||
#else
|
#else
|
||||||
ret = ctermid(buffer);
|
ret = ctermid(buffer);
|
||||||
|
@ -3342,7 +3352,7 @@ posix_tmpnam(self, args)
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, ":tmpnam"))
|
if (!PyArg_ParseTuple(args, ":tmpnam"))
|
||||||
return NULL;
|
return NULL;
|
||||||
#if defined(HAVE_TMPNAM_R) && defined(WITH_THREAD)
|
#ifdef USE_TMPNAM_R
|
||||||
name = tmpnam_r(buffer);
|
name = tmpnam_r(buffer);
|
||||||
#else
|
#else
|
||||||
name = tmpnam(buffer);
|
name = tmpnam(buffer);
|
||||||
|
@ -3350,7 +3360,7 @@ posix_tmpnam(self, args)
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
PyErr_SetObject(PyExc_OSError,
|
PyErr_SetObject(PyExc_OSError,
|
||||||
Py_BuildValue("is", 0,
|
Py_BuildValue("is", 0,
|
||||||
#ifdef HAVE_TMPNAM_R
|
#ifdef USE_TMPNAM_R
|
||||||
"unexpected NULL from tmpnam_r"
|
"unexpected NULL from tmpnam_r"
|
||||||
#else
|
#else
|
||||||
"unexpected NULL from tmpnam"
|
"unexpected NULL from tmpnam"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue