3 --- changer-src/chg-scsi.c.orig Sat Sep 19 03:55:13 1998
4 +++ changer-src/chg-scsi.c Mon Feb 22 20:00:39 1999
10 + /* if we have a long timeout, sleep a long time before access.
11 + * This is avoid lots of error messages for drives which need a lot of time
13 + if ((timeout /2) > 1) {
14 + timeout = timeout / 2;
18 while ((cnt<timeout) && (NULL==(out=fopen(tapedev,"w+")))){
23 /* Get the configuration parameters */
24 if (tape_device[0] >= '0' && tape_device[0] <= '9' && tape_device[1] == 0){
25 - read_config(changer_file,&chg);
26 + if (read_config(changer_file,&chg) == -1) {
27 + perror(changer_file);
30 confnum=atoi(tape_device);
31 use_slots = chg.conf[confnum].end-chg.conf[confnum].start+1;
32 slot_offset = chg.conf[confnum].start;
35 eject_tape(tape_device);
36 (void)unload(fd, drive_num, oldtarget);
37 - if (ask_clean(tape_device,need_sleep))
38 + if (clean_slot != -1 && ask_clean(tape_device,need_sleep))
39 clean_tape(fd,tape_device,clean_file,drive_num,
40 clean_slot,maxclean,time_file);
44 eject_tape(tape_device);
45 (void)unload(fd, drive_num, target);
46 - if (ask_clean(tape_device,need_sleep))
47 + if (clean_slot != -1 && ask_clean(tape_device,need_sleep))
48 clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
53 eject_tape(tape_device);
54 (void)unload(fd, drive_num, target);
55 - if (ask_clean(tape_device,need_sleep))
56 + if (clean_slot != -1 && ask_clean(tape_device,need_sleep))
57 clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
59 printf("%d %s\n", target, tape_device);