summaryrefslogtreecommitdiffstats
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index d15286d..1286e7d 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -131,11 +131,12 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
return NULL;
}
#ifdef HAVE_GETPWUID_R
- Py_BEGIN_ALLOW_THREADS
int status;
Py_ssize_t bufsize;
+ /* Note: 'pwd' will be used via pointer 'p' on getpwuid_r success. */
struct passwd pwd;
+ Py_BEGIN_ALLOW_THREADS
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
if (bufsize == -1) {
bufsize = DEFAULT_BUFFER_SIZE;
@@ -212,11 +213,12 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name)
if (PyBytes_AsStringAndSize(bytes, &name_chars, NULL) == -1)
goto out;
#ifdef HAVE_GETPWNAM_R
- Py_BEGIN_ALLOW_THREADS
int status;
Py_ssize_t bufsize;
+ /* Note: 'pwd' will be used via pointer 'p' on getpwnam_r success. */
struct passwd pwd;
+ Py_BEGIN_ALLOW_THREADS
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
if (bufsize == -1) {
bufsize = DEFAULT_BUFFER_SIZE;