Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / remdir.c,v
1 head    1.5;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.5
9 date    92.12.15.00.20.22;      author jromine; state Exp;
10 branches;
11 next    1.4;
12
13 1.4
14 date    90.04.05.15.31.28;      author sources; state Exp;
15 branches;
16 next    1.3;
17
18 1.3
19 date    90.04.05.14.45.48;      author sources; state Exp;
20 branches;
21 next    1.2;
22
23 1.2
24 date    90.02.05.14.39.39;      author sources; state Exp;
25 branches;
26 next    1.1;
27
28 1.1
29 date    90.02.05.14.38.59;      author sources; state Exp;
30 branches;
31 next    ;
32
33
34 desc
35 @@
36
37
38 1.5
39 log
40 @endif sugar
41 @
42 text
43 @/* remdir.c - remove a directory */
44 #ifndef lint
45 static char ident[] = "@@(#)$Id: remdir.c,v 1.4 1990/04/05 15:31:28 sources Exp jromine $";
46 #endif  lint
47
48 #include "../h/mh.h"
49 #include <stdio.h>
50
51
52 remdir (dir)
53 char *dir;
54 {
55 #if     !defined (BSD42) && !defined (SYS5DIR)
56     int     pid;
57 #endif  /* not BSD42 and not SYS5DIR */
58
59     m_update ();
60     (void) fflush (stdout);
61
62 #if     !defined (BSD42) && !defined (SYS5DIR)
63     switch (pid = vfork ()) {
64         case NOTOK: 
65             advise ("fork", "unable to");
66             return 0;
67
68         case OK: 
69             execl ("/bin/rmdir", "rmdir", dir, NULLCP);
70             execl ("/usr/bin/rmdir", "rmdir", dir, NULLCP);
71             fprintf (stderr, "unable to exec ");
72             perror ("rmdir");
73             _exit (-1);
74
75         default: 
76             if (pidXwait (pid, "rmdir"))
77                 return 0;
78             break;
79     }
80 #else   /* BSD42 or SYS5DIR */
81     if (rmdir (dir) == NOTOK) {
82         admonish (dir, "unable to remove directory");
83         return 0;
84     }
85 #endif  /* BSD42 or SYS5DIR */
86
87     return 1;
88 }
89 @
90
91
92 1.4
93 log
94 @add ID
95 @
96 text
97 @d3 1
98 a3 1
99 static char ident[] = "@@(#)$Id:$";
100 d15 1
101 a15 1
102 #endif  not BSD42 and not SYS5DIR
103 d38 1
104 a38 1
105 #else   BSD42 or SYS5DIR
106 d43 1
107 a43 1
108 #endif  BSD42 or SYS5DIR
109 @
110
111
112 1.3
113 log
114 @add ID
115 @
116 text
117 @d3 1
118 a3 1
119 static char ident[] = "$Id:";
120 @
121
122
123 1.2
124 log
125 @SYS5DIR routines
126 @
127 text
128 @d2 3
129 @
130
131
132 1.1
133 log
134 @Initial revision
135 @
136 text
137 @d10 1
138 a10 1
139 #ifndef BSD42
140 d12 1
141 a12 1
142 #endif  not BSD42
143 d17 1
144 a17 1
145 #ifndef BSD42
146 d35 1
147 a35 1
148 #else   BSD42
149 d40 1
150 a40 1
151 #endif  BSD42
152 @