JJLATERthese 2 patches fail, I havent had time to look why

8.2-RELEASE: usr.bin/tar
8.3-RELEASE: contrib/libarchive/tar

*** 8.3-RELEASE-generic/src/contrib/libarchive/tar/util.c	Mon Jun 14 04:09:06 2010
--- generic+jhs_error_detect/src/contrib/libarchive/tar/util.c	Mon Jan 31 05:42:32 2011
***************
*** 249,254 ****
--- 251,263 ----
  	fflush(stderr);
  
  	l = read(2, buff, sizeof(buff) - 1);
+ 	if (l < 0) 							// JHS
+ 		{							// JHS
+ 		perror(NULL) ;						// JHS
+ 		fprintf(stderr,"Failed to read yes/no\n" ); 		// JHS
+ 		fprintf(stderr,"File: %s, Line %d, Ret %d\n", 		// JHS
+ 			__FILE__, __LINE__, (int)l );			// JHS	
+ 		}							// JHS
  	if (l <= 0)
  		return (0);
  	buff[l] = 0;
***************
*** 307,312 ****
--- 316,331 ----
  		/* Get some more data into the buffer. */
  		bytes_wanted = buff + buff_length - buff_end;
  		bytes_read = fread(buff_end, 1, bytes_wanted, f);
+ 		if (							// JHS
+ 			( bytes_read < bytes_wanted )			// JHS
+ 			|| 						// JHS
+ 			(bytes_read = 0)				// JHS
+ 		   )	{						// JHS
+ 			perror(NULL) ;					// JHS
+ 			fprintf(stderr,					// JHS
+ 				"File: %s, Line %d, Ret %d\n",		// JHS
+ 				__FILE__, __LINE__, (int)bytes_read ); 	// JHS
+ 			}						// JHS
  		buff_end += bytes_read;
  		/* Process all complete lines in the buffer. */
  		while (line_end < buff_end) {
