Get rid of warnings about undefined crypt() and assignment in if().
authorMichael Poole <mdpoole@troilus.org>
Fri, 25 Jun 2004 12:01:36 +0000 (12:01 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 25 Jun 2004 12:01:36 +0000 (12:01 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1082 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
configure
configure.in
ircd/ircd_crypt_native.c
ircd/umkpasswd.c

index 054d663c96fb8fa095beb7afe6fc5806176bbb7b..1e217b94c5441cc98acc2349c6a2503a2fe153fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-06-25  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * doc/Authors: Add contributors to ircu2.10.11 and myself.
index e4fc9713d2296fbd81c4f90526e9051d55f2c1bb..b160d478f2ad957bf71bc5ea7096dee1ac87cfa3 100755 (executable)
--- 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
index c381605e3a662867b2815c54caa9e001768eab97..d827312a7c06ffb8e1703d15129ecdf6a18d9d45 100644 (file)
@@ -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
index 5fa2afcda828299f8587583c145c4a3d8cd717ec..02a170805f487e09b9c0b8b797fa4899f9ff5a93 100644 (file)
  *
  * $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 <assert.h>
 #include <unistd.h>
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
 
 /* well this bit is (kinda) intact :) -- hikari */
 const char* ircd_crypt_native(const char* key, const char* salt)
index 8ad0e1f68213d3f1ceb11c08eaf9e01bc2862958..56d24dccdfc456b5473f8c69bc6b3fb8c7803a5c 100644 (file)
@@ -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);