2005-11-08 Oliver Kiddle <okiddle@yahoo.co.uk>
+ * Simon Burge: acconfig.h, configure.in, uip/rcvtty.c, uip/slocal.c:
+ fix to handle getutent() on NetBSD
+
* INSTALL, README, docs/README.about, man/nmh.man: update most
references to the web page and mailing list locations
/* Define to 1 if struct tm has gmtoff */
#undef HAVE_TM_GMTOFF
+/* Define to 1 if struct utmp has ut_type */
+#undef HAVE_UTMP_UT_TYPE
+
/* Define if your system has sigsetjmp */
#undef HAVE_SIGSETJMP
AC_DEFINE(HAVE_TM_GMTOFF)
fi
+AC_CACHE_CHECK(for ut_type in struct utmp, nmh_cv_struct_utmp_ut_type,
+[AC_TRY_COMPILE(
+[#include <utmp.h>],
+[struct utmp temputmp; temputmp.ut_type = 0;],
+ nmh_cv_struct_utmp_ut_type=yes, nmh_cv_struct_utmp_ut_type=no)])
+if test $nmh_cv_struct_utmp_ut_type = yes; then
+ AC_DEFINE(HAVE_UTMP_UT_TYPE)
+fi
+
dnl -------------
dnl CHECK SIGNALS
dnl -------------
#ifdef HAVE_GETUTENT
setutent();
while ((utp = getutent()) != NULL) {
- if (utp->ut_type == USER_PROCESS
- && utp->ut_user[0] != 0
+ if (
+#ifdef HAVE_UTMP_UT_TYPE
+ utp->ut_type == USER_PROCESS
+ &&
+#endif
+ utp->ut_name[0] != 0
&& utp->ut_line[0] != 0
- && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
+ && strncmp (user, utp->ut_name, sizeof(utp->ut_name)) == 0) {
strncpy (tty, utp->ut_line, sizeof(utp->ut_line));
alert (tty, md);
}
setutent();
while ((utp = getutent()) != NULL) {
- if (utp->ut_type == USER_PROCESS
- && utp->ut_user[0] != 0
- && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
+ if (
+#ifdef HAVE_UTMP_UT_TYPE
+ utp->ut_type == USER_PROCESS
+ &&
+#endif
+ utp->ut_name[0] != 0
+ && strncmp (user, utp->ut_name, sizeof(utp->ut_name)) == 0) {
if (debug)
continue;
endutent();