summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2018-09-09 01:10:59 +0200
committerMarco d'Itri <md@linux.it>2018-09-12 02:26:55 +0200
commit8392fd349dfc25080fcd022a0bbd32e6590c85a8 (patch)
treedaad94d35976b0e78389d46a05dc3cd5233d7581 /config.h
parent5fc64b5eba57177aa5956bfd0ba274e4782f8078 (diff)
downloadwhois-8392fd349dfc25080fcd022a0bbd32e6590c85a8.tar.gz
mkpasswd: use perror with crypt and crypt_gensalt
Only some implementations of crypt(3) set errno on errors.
Diffstat (limited to 'config.h')
-rw-r--r--config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.h b/config.h
index 112d14c..66f7e71 100644
--- a/config.h
+++ b/config.h
@@ -95,6 +95,13 @@
# define HAVE_GETENTROPY
#endif
+/* some versions of crypt(3) set errno on error */
+#if defined __GLIBC__ || (defined __SVR4 && defined __sun) || defined OpenBSD || AIX
+# define CRYPT_SETS_ERRNO 1
+#else
+# define CRYPT_SETS_ERRNO 0
+#endif
+
#ifdef ENABLE_NLS
# ifndef NLS_CAT_NAME
# define NLS_CAT_NAME "whois"