2 Proprietary Rand Corporation
, 1981.
3 Further distribution of
this software
4 subject to the terms of the Rand
12 extern char *sprintf();
21 { "lsproc", &lsproc
},
22 { "mh_deliver", &mh_deliver
},
23 { "prproc", &prproc
},
24 { "scanproc", &scanproc
},
25 { "showproc", &showproc
},
26 { "sendproc", &sendproc
},
27 { "fileproc", &fileproc
},
33 register struct node
*np
;
34 register int state
, wpid
, pid
;
35 register struct procs
*ps
;
38 char name
[NAMESZ
], field
[1024];
41 return; /* We've already been called! */
43 if((mypath
= getenv("HOME")) == NULL
) {
44 fprintf(stderr
, "HOME environment variable not set!\n");
47 VOID
sprintf(defpath
, "%s%s", mypath
, mh_prof
);
48 /*** copy(mh_prof, copy(mypath, defpath)); ***/
50 if((ib
= fopen(defpath
, "r")) == NULL
) {
51 if((pid
= fork()) == 0) {
52 execl(installproc
, "install-mh", "-auto", 0);
53 fprintf(stderr
, "Can't exec ");perror(installproc
);
55 } else if(pid
== -1) {
56 fprintf(stderr
, "No forks!\n");
59 while((wpid
= wait(&status
)) != -1 && wpid
!= pid
)
61 if(status
|| (ib
= fopen(defpath
, "r")) == NULL
) {
62 fprintf(stderr
, "[install-mh aborted]\n");
67 #ifdef NEWS /* NOT CONVERTED TO V7!!! */
68 VOID
fstat(fildes(ib
), field
);
69 deftime
= (&field
)->i_atime
;
72 np
= (struct node
*) &m_defs
;
75 switch(state
= m_getfld(state
,name
,field
,sizeof field
,ib
)) {
78 np
->n_next
= (struct node
*) malloc(sizeof *np
);
80 np
->n_name
= getcpy(name
);
81 np
->n_field
= trimcpy(field
);
83 for(ps
= procs
; ps
->procname
; ps
++)
84 if(strcmp(np
->n_name
, ps
->procname
) == 0) {
85 *ps
->procnaddr
= np
->n_field
;
95 fprintf(stderr
, ".mh_profile must not contain a body--it can't \
96 end with a blank line!\n");
98 fprintf(stderr
, "Bad format: .mh_profile!\n");