As of 1.5, upstream no longer supported utmp:
http://git.savannah.gnu.org/cgit/nmh.git/patch/?id=7ba29497ff3f164e2a507eda35e81f1cb0658c74 Without utmp support (or utmpx in openbsd), rcvtty(1) will not notify the terminal upon receipt of new mail... which is why it exists. We still want rcvtty to work, so bring the utmp support back as a local patch. ok bentley@
This commit is contained in:
parent
1bb8640529
commit
2f823059e9
@ -1,8 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.33 2012/06/18 16:03:00 pascal Exp $
|
||||
# $OpenBSD: Makefile,v 1.34 2013/01/02 04:19:54 william Exp $
|
||||
|
||||
COMMENT= new MH mail handling program
|
||||
|
||||
DISTNAME= nmh-1.5
|
||||
REVISION= 0
|
||||
CATEGORIES= mail
|
||||
MASTER_SITES= ${MASTER_SITE_SAVANNAH:=nmh/}
|
||||
HOMEPAGE= http://www.nongnu.org/nmh/
|
||||
|
47
mail/nmh/patches/patch-uip_rcvtty_c
Normal file
47
mail/nmh/patches/patch-uip_rcvtty_c
Normal file
@ -0,0 +1,47 @@
|
||||
$OpenBSD: patch-uip_rcvtty_c,v 1.1 2013/01/02 04:19:55 william Exp $
|
||||
|
||||
Upstream no longer supports utmp...
|
||||
http://git.savannah.gnu.org/cgit/nmh.git/patch/?id=7ba29497ff3f164e2a507eda35e81f1cb0658c74
|
||||
|
||||
|
||||
--- uip/rcvtty.c.orig Mon Jun 11 00:06:19 2012
|
||||
+++ uip/rcvtty.c Tue Jan 1 18:11:37 2013
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#ifdef HAVE_GETUTXENT
|
||||
#include <utmpx.h>
|
||||
+#else
|
||||
+#include <utmp.h>
|
||||
#endif /* HAVE_GETUTXENT */
|
||||
|
||||
#define SCANFMT \
|
||||
@@ -83,7 +85,12 @@ main (int argc, char **argv)
|
||||
int md, vecp = 0;
|
||||
char *cp, *user, buf[BUFSIZ], tty[BUFSIZ];
|
||||
char **argp, **arguments, *vec[MAXARGS];
|
||||
+#if HAVE_GETUTXENT
|
||||
struct utmpx *utp;
|
||||
+#else
|
||||
+ struct utmp ut;
|
||||
+ register FILE *uf;
|
||||
+#endif
|
||||
#ifdef LOCALE
|
||||
setlocale(LC_ALL, "");
|
||||
#endif
|
||||
@@ -169,6 +176,16 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
endutxent();
|
||||
+#else
|
||||
+ if ((uf = fopen (_PATH_UTMP, "r")) == NULL)
|
||||
+ exit (RCV_MBX);
|
||||
+ while (fread ((char *) &ut, sizeof(ut), 1, uf) == 1)
|
||||
+ if (ut.ut_name[0] != 0
|
||||
+ && strncmp (user, ut.ut_name, sizeof(ut.ut_name)) == 0) {
|
||||
+ strncpy (tty, ut.ut_line, sizeof(ut.ut_line));
|
||||
+ alert (tty, md);
|
||||
+ }
|
||||
+ fclose (uf);
|
||||
#endif /* HAVE_GETUTXENT */
|
||||
|
||||
exit (RCV_MOK);
|
Loading…
Reference in New Issue
Block a user