]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/makedir.c
Fixed inc(1) and %(me) to not obey Local-Mailbox profile component.
[nmh] / docs / historical / mh-jun-1982 / subs / makedir.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../mh.h"
9 #include <stdio.h>
10
11 makedir(dir)
12 char *dir;
13 {
14 register int pid, wpid;
15 register char *c;
16 int status;
17
18 if((pid = fork()) == 0) {
19 execl("/bin/mkdir", "mkdir", dir, 0);
20 execl("/usr/bin/mkdir", "mkdir", dir, 0);
21 fprintf(stderr, "Can't exec mkdir!!?\n");
22 return(0);
23 }
24 if(pid == -1) {
25 fprintf(stderr, "Can't fork\n");
26 return(0);
27 }
28 while((wpid = wait(&status)) != pid && wpid != -1) ;
29 if(status) {
30 fprintf(stderr, "Bad exit status (%o) from mkdir.\n", status);
31 return(0);
32 }
33 if((c = m_find("folder-protect")) == NULL)
34 c = foldprot;
35 VOID chmod(dir, atooi(c));
36 return(1);
37 }