Annotation of researchv10no/cmd/worm/oscsi/warm.c, revision 1.1

1.1     ! root        1: #include       <stddef.h>
        !             2: #include       <stdio.h>
        !             3: #include       <string.h>
        !             4: #include       "scsi.h"
        !             5: #include       "juke.h"
        !             6: 
        !             7: warm_inv(char *buf)
        !             8: {
        !             9:        Side side;
        !            10:        int drive, sh;
        !            11:        char vol_id[512];
        !            12:        
        !            13:        if(j_rdshelves(buf))    /* read in shelf names */
        !            14:                return(-1);
        !            15:        side = SIDEA;
        !            16:        drive = min(nlun+1, NLUN-1);
        !            17:        for(;;){
        !            18:                if(j_getstatus(buf))    /* get the jukebox status */
        !            19:                        return(-1);
        !            20:                for(sh = 0; sh < NSHELF; sh++)
        !            21:                        if(j_status.shelf[sh]&0x10) break;
        !            22:                if(sh >= NSHELF)
        !            23:                        break;
        !            24:                if(getvol(127, drive, vol_id, &side)){
        !            25:                        strcpy(buf, vol_id);
        !            26:                        return(-1);
        !            27:                }
        !            28:                for(sh = 0; j_shelf[sh]; sh++)
        !            29:                        ;
        !            30:                printf("%s -> %d\n", vol_id, sh);
        !            31:                if(j_drive_to_shelf(drive, sh, side, buf) < 0)
        !            32:                        return(-1);
        !            33:                j_wrshelf = 1;
        !            34:                j_shelf[sh] = strdup(vol_id);
        !            35:                sleep(1);
        !            36:        }
        !            37:        return(0);
        !            38: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.