Thread View: comp.mail.misc
1 messages
1 total messages
Started by Paul Vixie
Wed, 13 May 1987 19:21
Patch to MH prompter to handle SIGHUP gracefully
Author: 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);
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads