source: trunk/athena/bin/attach/mul.c @ 5832

Revision 5832, 1.2 KB checked in by probe, 33 years ago (diff)
Avoid comments about "already detached" with detach -a. Don't bother trying to detach filesystems associated with the type MUL filesystem that no longer exist.
Line 
1/*
2 * $Header: /afs/dev.mit.edu/source/repository/athena/bin/attach/mul.c,v 1.4 1992-01-27 03:11:42 probe Exp $
3 *
4 * Copyright (c) 1990 by the Massachusetts Institute of Technology.
5 */
6
7static char *rcsid_mul_c = "$Header: /afs/dev.mit.edu/source/repository/athena/bin/attach/mul.c,v 1.4 1992-01-27 03:11:42 probe Exp $";
8
9#include "attach.h"
10#include <string.h>
11
12int mul_attach(atp, mopt, errorout)
13struct _attachtab *atp;
14struct mntopts *mopt;
15int errorout;
16{
17        char mul_buf[BUFSIZ], *cp = mul_buf, *mp;
18       
19        strcpy(mul_buf, atp->hostdir);
20        while (mp = cp) {
21                cp = index(mp, ',');
22                if (cp)
23                        *cp = '\0';
24                attach(mp);
25                if (cp)
26                        cp++;
27        }
28        return SUCCESS;
29}
30
31int mul_detach(atp)
32struct _attachtab *atp;
33{
34    int status = SUCCESS;
35    char mul_buf[BUFSIZ], *cp;
36   
37    strcpy(mul_buf, atp->hostdir);
38    cp = &mul_buf[strlen(mul_buf)];
39    while (cp-- >= mul_buf) {
40        explicit = 0;
41        if (cp < mul_buf || *cp == ',') {
42            if (attachtab_lookup(cp+1)
43                && detach(cp+1) != SUCCESS
44                && error_status != ERR_DETACHNOTATTACHED)
45                status = FAILURE;
46            if (cp >= mul_buf)
47                *cp = '\0';
48        }
49    }
50
51    error_status = (status == SUCCESS) ? ERR_NONE : ERR_SOMETHING;
52    return status;
53}
Note: See TracBrowser for help on using the repository browser.