Updated docs/README-ATTACHMENTS, mainly to reflect that no setup is
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / push.c,v
1 head    1.3;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.3
9 date    92.12.15.00.20.22;      author jromine; state Exp;
10 branches;
11 next    1.2;
12
13 1.2
14 date    92.12.14.17.47.34;      author jromine; state Exp;
15 branches;
16 next    1.1;
17
18 1.1
19 date    92.12.14.17.44.38;      author jromine; state Exp;
20 branches;
21 next    ;
22
23
24 desc
25 @@
26
27
28 1.3
29 log
30 @endif sugar
31 @
32 text
33 @/* push.c - push a fork into the background */
34 #ifndef lint
35 static char ident[] = "@@(#)$Id: push.c,v 1.2 1992/12/14 17:47:34 jromine Exp jromine $";
36 #endif  /* lint */
37
38 #include "../h/mh.h"
39 #include <stdio.h>
40 #include <signal.h>
41
42
43 void    push () {
44     register int     i;
45
46     for (i = 0; i < 5; i++) {
47         switch (fork ()) {
48             case NOTOK: 
49                 sleep (5);
50                 continue;
51
52             case OK: 
53                 (void) signal (SIGHUP, SIG_IGN);
54                 (void) signal (SIGINT, SIG_IGN);
55                 (void) signal (SIGQUIT, SIG_IGN);
56                 (void) signal (SIGTERM, SIG_IGN);
57 #ifdef  SIGTSTP
58                 (void) signal (SIGTSTP, SIG_IGN);
59                 (void) signal (SIGTTIN, SIG_IGN);
60                 (void) signal (SIGTTOU, SIG_IGN);
61 #endif  /* SIGTSTP */
62                 (void) freopen ("/dev/null", "r", stdin);
63                 (void) freopen ("/dev/null", "w", stdout);
64                 break;
65
66             default: 
67                 done (0);
68         }
69         break;
70     }
71     if (i >= 5)
72         advise (NULLCP, "unable to fork, so can't push...");
73 }
74 @
75
76
77 1.2
78 log
79 @add id
80 @
81 text
82 @d3 1
83 a3 1
84 static char ident[] = "@@(#)$Id: pidwait.c,v 1.9 1992/12/14 17:10:58 jromine Exp $";
85 d29 1
86 a29 1
87 #endif  SIGTSTP
88 @
89
90
91 1.1
92 log
93 @Initial revision
94 @
95 text
96 @d2 3
97 @