[EMAIL PROTECTED] (Ruud de Rooij) wrote:
> This bug has been fixed in nmh 1.0.3 and we encourage you to upgrade
> immediately. The fixed package is available at
>
> ftp://ftp.mhost.com/pub/nmh/nmh-1.0.3.tar.gz
Just updating the FreeBSD port to nmh-1.0.3 and ran across this
problem...
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O -pipe -DFLOCK_LOCKING slocal.c
slocal.c:39: conflicting types for `initgroups'
/usr/include/unistd.h:146: previous declaration of `initgroups'
*** Error code 1
On my FreeBSD 3.2 & 3.3 systems, unistd.h has this prototype for initgroups:
int initgroups __P((const char *, int));
and this for gid_t:
typedef u_int32_t gid_t; /* group id */
so the types on that 2nd arg don't match. I'm just ifdef'ing out that
duplicate prototype as in the appended patch.
[EMAIL PROTECTED]
diff -ur ../../../nmh-1.0.3-DIST/uip/slocal.c ./uip/slocal.c
--- ../../../nmh-1.0.3-DIST/uip/slocal.c Sun Feb 6 04:41:00 2000
+++ ./uip/slocal.c Mon Feb 28 10:42:31 2000
@@ -32,11 +32,17 @@
#include <grp.h> /* initgroups() is here on Solaris 2.6 */
#include <unistd.h> /* initgroups() is here on HP-UX 10.20 */
+#if !defined(BSD44)
+/* On FreeBSD 3.2 (at least), initgroups is prototyped in unistd.h with a
+ 'int' arg instead of a 'gid_t' (which is unsigned) arg. The prototype below
+ produces a "conflicting types for `initgroups'" error. */
+
/* On AIX 4.1, initgroups() is defined and even documented (giving the parameter
types as "char*" and "int"), but doesn't have a prototype in any of the
system header files. On other OSes, this should be a duplicate prototype
that won't cause any errors or warnings. */
extern int initgroups(const char*, gid_t);
+#endif
#ifdef HAVE_DB1_NDBM_H
#include <db1/ndbm.h>