View | Details | Raw Unified | Return to bug 20501
Collapse All | Expand All

(-)main.c (-2 / +7 lines)
Lines 87-92 Link Here
87
long	dev_bsize = 1;	/* recalculated below */
87
long	dev_bsize = 1;	/* recalculated below */
88
long	blocksperfile;	/* output blocks per file */
88
long	blocksperfile;	/* output blocks per file */
89
char	*host = NULL;	/* remote host (if any) */
89
char	*host = NULL;	/* remote host (if any) */
90
int	loader = 0;	/* offline tape autoloader */
90
91
91
static long numarg __P((char *, long, long));
92
static long numarg __P((char *, long, long));
92
static void obsolete __P((int *, char **[]));
93
static void obsolete __P((int *, char **[]));
Lines 123-131 Link Here
123
124
124
	obsolete(&argc, &argv);
125
	obsolete(&argc, &argv);
125
#ifdef KERBEROS
126
#ifdef KERBEROS
126
#define optstring "0123456789aB:b:cd:f:h:kns:T:uWw"
127
#define optstring "0123456789aB:b:cd:f:h:klns:T:uWw"
127
#else
128
#else
128
#define optstring "0123456789aB:b:cd:f:h:ns:T:uWw"
129
#define optstring "0123456789aB:b:cd:f:h:lns:T:uWw"
129
#endif
130
#endif
130
	while ((ch = getopt(argc, argv, optstring)) != -1)
131
	while ((ch = getopt(argc, argv, optstring)) != -1)
131
#undef optstring
132
#undef optstring
Lines 173-178 Link Here
173
			dokerberos = 1;
174
			dokerberos = 1;
174
			break;
175
			break;
175
#endif
176
#endif
177
178
		case 'l':		/* tape loader */
179
			loader = 1;
180
			break;
176
181
177
		case 'n':		/* notify operators */
182
		case 'n':		/* notify operators */
178
			notify = 1;
183
			notify = 1;
(-)tape.c (-7 / +36 lines)
Lines 43-48 Link Here
43
#include <sys/socket.h>
43
#include <sys/socket.h>
44
#include <sys/time.h>
44
#include <sys/time.h>
45
#include <sys/wait.h>
45
#include <sys/wait.h>
46
#include <sys/ioctl.h>
47
#include <sys/mtio.h>
46
#ifdef sunos
48
#ifdef sunos
47
#include <sys/vnode.h>
49
#include <sys/vnode.h>
48
50
Lines 78-83 Link Here
78
extern	int ntrec;		/* blocking factor on tape */
80
extern	int ntrec;		/* blocking factor on tape */
79
extern	int cartridge;
81
extern	int cartridge;
80
extern	char *host;
82
extern	char *host;
83
extern  int loader;
81
char	*nexttape;
84
char	*nexttape;
82
85
83
static	int atomic __P((ssize_t (*)(), int, char *, int));
86
static	int atomic __P((ssize_t (*)(), int, char *, int));
Lines 374-393 Link Here
374
close_rewind()
377
close_rewind()
375
{
378
{
376
	time_t tstart_changevol, tend_changevol;
379
	time_t tstart_changevol, tend_changevol;
380
	int gottape=0;
377
381
378
	trewind();
382
	trewind();
379
	if (nexttape)
383
	if (nexttape)
380
		return;
384
		return;
381
	(void)time((time_t *)&(tstart_changevol));
385
	(void)time((time_t *)&(tstart_changevol));
382
	if (!nogripe) {
386
	if (loader) {
383
		msg("Change Volumes: Mount volume #%d\n", tapeno+1);
387
		struct mtop MtOp;
384
		broadcast("CHANGE DUMP VOLUMES!\7\7\n");
388
		int f,tx=0;
389
390
		msg("Mounting next tape on %s\n",tape);
391
392
		if ((f = open(tape,0)) < 0) 
393
		        quit("can't re-open tape loader after rewind");
394
		
395
		MtOp.mt_op = MTOFFL;
396
		MtOp.mt_count = 1;
397
		if (ioctl(f,MTIOCTOP,&MtOp) < 0)
398
			quit("can't offline tape loader");
399
                (void) close(f);
400
		sleep(10);
401
                while ((f = open(tape,0)) < 0 && tx++ < 12)
402
                        sleep (10);
403
		if (f >= 0) {
404
		        (void) close(f);
405
                        gottape = 1;
406
		}
385
	}
407
	}
386
	while (!query("Is the new volume mounted and ready to go?"))
408
	if (!gottape) {
387
		if (query("Do you want to abort?")) {
409
		if (!nogripe) {
388
			dumpabort(0);
410
	        	msg("Change Volumes: Mount volume #%d\n", tapeno+1);
389
			/*NOTREACHED*/
411
                        broadcast("CHANGE DUMP VOLUMES!\7\7\n");               
390
		}
412
		}
413
		while (!query("Is the new volume mounted and ready to go?"))
414
	        	if (query("Do you want to abort?")) {
415
	                	dumpabort(0);
416
		         	/*NOTREACHED*/
417
	         	}
418
	}
419
391
	(void)time((time_t *)&(tend_changevol));
420
	(void)time((time_t *)&(tend_changevol));
392
	if ((tstart_changevol != (time_t)-1) && (tend_changevol != (time_t)-1))
421
	if ((tstart_changevol != (time_t)-1) && (tend_changevol != (time_t)-1))
393
		tstart_writing += (tend_changevol - tstart_changevol);
422
		tstart_writing += (tend_changevol - tstart_changevol);

Return to bug 20501