Newsgroups: comp.unix.i386
Path: utzoo!sq!lee
From: lee@sq.sq.com (Liam R. E. Quin)
Subject: Re: Backup utilities for ix-386
Message-ID: <1989Oct27.022626.21927@sq.sq.com>
Keywords: backup ix-386
Reply-To: lee@sq.com (Liam R. E. Quin)
Organization: Unixsys (UK) Ltd (visiting SoftQuad Inc., Toronto)
References: <107@gizzmo.UUCP> <185@softest.UUCP> <[253554b6:333.1]comp.unix.i386;1@vpnet.UUCP> <11954@watcgl.waterloo.edu> <3741@dell.dell.com> <329@rsiatl.UUCP> <1605@ctisbv.cti-software.nl>
Date: Fri, 27 Oct 89 02:26:26 GMT

In article <1605@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@sq.com (until Dec 89, then lee@anduk.co.uk again).

