From 04c8e6162ef4684cd531ca0311fec858186fe819 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Fri, 25 Jun 2004 12:01:36 +0000 Subject: [PATCH] Get rid of warnings about undefined crypt() and assignment in if(). git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1082 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 12 ++++++++++++ configure | 4 +++- configure.in | 2 +- ircd/ircd_crypt_native.c | 9 ++++++--- ircd/umkpasswd.c | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 054d663..1e217b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-06-25 Michael Poole + + * configure.in: Check for crypt.h as well. + + * configure: Regenerate. + + * ircd/ircd_crypt_native.c: Move XOPEN defines earlier so they + affect the first includes of system headers. Include crypt.h if + it is available. + + * ircd/umkpasswd.c: Quash a gcc warning. + 2004-06-23 Michael Poole * doc/Authors: Add contributors to ircu2.10.11 and myself. diff --git a/configure b/configure index e4fc971..b160d47 100755 --- a/configure +++ b/configure @@ -3881,7 +3881,9 @@ done -for ac_header in poll.h sys/devpoll.h sys/epoll.h sys/event.h + + +for ac_header in crypt.h inttypes.h poll.h sys/devpoll.h sys/epoll.h sys/event.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/configure.in b/configure.in index c381605..d827312 100644 --- a/configure.in +++ b/configure.in @@ -113,7 +113,7 @@ AC_SEARCH_LIBS(res_mkquery, resolv, , dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(inttypes.h poll.h sys/devpoll.h sys/epoll.h sys/event.h) +AC_CHECK_HEADERS(crypt.h inttypes.h poll.h sys/devpoll.h sys/epoll.h sys/event.h) dnl Checks for typedefs, structures, and compiler characteristics dnl AC_C_CONST diff --git a/ircd/ircd_crypt_native.c b/ircd/ircd_crypt_native.c index 5fa2afc..02a1708 100644 --- a/ircd/ircd_crypt_native.c +++ b/ircd/ircd_crypt_native.c @@ -18,17 +18,20 @@ * * $Id$ */ +#define _XOPEN_SOURCE +#define _XOPEN_VERSION 4 + #include "config.h" #include "ircd_crypt.h" #include "ircd_crypt_native.h" #include "s_debug.h" #include "ircd_alloc.h" -#define _XOPEN_SOURCE -#define _XOPEN_VERSION 4 - #include #include +#ifdef HAVE_CRYPT_H +#include +#endif /* well this bit is (kinda) intact :) -- hikari */ const char* ircd_crypt_native(const char* key, const char* salt) diff --git a/ircd/umkpasswd.c b/ircd/umkpasswd.c index 8ad0e1f..56d24dc 100644 --- a/ircd/umkpasswd.c +++ b/ircd/umkpasswd.c @@ -172,7 +172,7 @@ unsigned char buffer[1024], digest[16]; if (NULL == (file = fopen(tmp, "r"))) exit(0); MD5Name(MD5Init)(&context); - while (len = fread (buffer, 1, 1024, file)) + while ((len = fread (buffer, 1, 1024, file))) MD5Name(MD5Update)(&context, buffer, len); MD5Name(MD5Final)(digest, &context); fclose(file); -- 2.20.1