Article View: comp.mail.misc
Article #4185Patch to MH prompter to handle SIGHUP gracefully
From: Paul Vixie
Date: Wed, 13 May 1987 19:21
Date: Wed, 13 May 1987 19:21
57 lines
2248 bytes
2248 bytes
Our network is a little flakey today, and I just lost about 60 lines of reply
text because 'prompter' just croaks on a SIGHUP, without leaving your text in
Mail/draft. The fix was easy enough... I put it into the #ifdef's for BSD42,
since all the other signal and setjmp stuff seems to be that way -- I don't
know why, but since I don't run SYSV, it doesn't really matter to me.
Two questions, then the patch: (1) who do I mail this to to have it included in
the official release? (2) how do I get a more recent release? This patch is
for the version of prompter.c that came on the 4.3BSD tape, namely MH 6.2. I
know that MH 6.5 exists, but I don't know how to get it.
cd to /usr/src/new/mh/uip and run 'patch' over this article:
Index: prompter.c
*** prompter.c.ucb Wed May 13 11:54:01 1987
--- prompter.c Wed May 13 12:04:23 1987
***************
*** 80,85 ****
--- 80,87 ----
#ifdef BSD42
static jmp_buf sigenv;
+ static jmp_buf sighup_env;
+ static int sighup_func() { longjmp(sighup_env, 1); }
#endif BSD42
/* */
***************
*** 221,226 ****
--- 223,234 ----
sigint = 0;
setsig (SIGINT, intrser);
+ #ifdef BSD42
+ if (setjmp(sighup_env))
+ goto sighup;
+ signal(SIGHUP, sighup_func);
+ #endif BSD42
+
for (state = FLD;;) {
switch (state = m_getfld (state, name, field, sizeof field, in)) {
case FLD:
***************
*** 323,328 ****
--- 331,341 ----
if (body)
printf ("--------\n");
(void) fflush (stdout);
+
+ #ifdef BSD42
+ sighup: ;
+ (void) signal(SIGHUP, SIG_IGN);
+ #endif BSD42
(void) fclose (in);
(void) fclose (out);
Technical Details
Message-ID:
<1155@ubvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!gatech!hao!ames!ucbcad!ucbvax!hplabs!cae780!ubvax!vixShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!gatech!hao!ames!ucbcad!ucbvax!hplabs!cae780!ubvax!vix From: vix@ubvax.UUCP (Paul Vixie) Newsgroups: comp.mail.misc,comp.bugs.4bsd Subject: Patch to MH prompter to handle SIGHUP gracefully Message-ID: <1155@ubvax.UUCP> Date: Wed, 13-May-87 15:21:19 EDT Article-I.D.: ubvax.1155 Posted: Wed May 13 15:21:19 1987 Date-Received: Sat, 16-May-87 07:44:50 EDT Reply-To: vix@ubvax.UUCP (Paul Vixie) Distribution: world Organization: Ungermann-Bass Enterprises Lines: 57