Skip to content

Commit

Permalink
Remove the HAVE_CRYPT_R and HAVE_CRYPT_H ifdefs
Browse files Browse the repository at this point in the history
We assume they are available on the system.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Karolina Surma <ksurma@redhat.com>
  • Loading branch information
3 people authored and hroncok committed Apr 27, 2024
1 parent 04d2896 commit 77023b9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Modules/_cryptmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#include "Python.h"

#include <sys/types.h>
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif

/* Module crypt */

Expand Down Expand Up @@ -74,13 +72,9 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
}

char *crypt_result;
#ifdef HAVE_CRYPT_R
struct crypt_data data;
memset(&data, 0, sizeof(data));
crypt_result = crypt_r(word, salt, &data);
#else
crypt_result = crypt(word, salt);
#endif
if (crypt_result == NULL) {
return PyErr_SetFromErrno(PyExc_OSError);
}
Expand Down

0 comments on commit 77023b9

Please sign in to comment.