Backup utilities for ix-386

Liam R. E. Quin lee at sq.sq.com
Fri Oct 27 12:26:26 AEST 1989


In article <1605 at ctisbv.cti-software.nl> (Pim Zandbergen) posts a patch to
afio to handle end-of-tape.
But I spot an error in the patch:
>
>[...] it was quite easy to fix afio to
>recognize ENXIO. This way, you can use afio with any raw device,
>without having to know its capacity.
>
>--- 2164,2175 ----
>  				    ? syserr()
>  				    : "Apparently full");
>  				_exit(1);
>! 			} else if (got < 0) {
>! 				if (errno = ENXIO)
					  ^^^
This should be ==, not =.  The sysmptom is that you will never get the
error message, even when errno is not ENXIO.  It might be worth
setting errno to zero afterwards, too, if case there is a non-system error
afterwards and afio checks errno to see whether to call perror().

Hence we get
 				if (errno == ENXIO) {
					errno = 0;
 					next(O_WRONLY, "End of medium");
				} else

--
Liam Russell Quin, Unixsys (UK) Ltd
lee at sq.com (until Dec 89, then lee at anduk.co.uk again).




More information about the Comp.unix.i386 mailing list