below is a copy of write.c.p1b.REL=8.1-RELEASE.diff to be edited. *** 8.0_1_2-RELEASE-generic/src/usr.bin/tar/write.c Mon Jun 14 04:09:06 2010 --- generic+jhs_error_detect/src/usr.bin/tar/write.c Sat Jan 29 18:34:55 2011 *************** *** 945,951 **** } progress += bytes_written; bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN); ! } return 0; } --- 959,994 ---- } progress += bytes_written; bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN); ! if (bytes_read < 0) // JHS ! { // JHS ! perror(NULL) ; // JHS ! fprintf(stderr,"Read error.\n"); // JHS ! // fprintf(stderr,"Read error on %s.\n", // JHS ! // Please pass in name as parameter to print. // JHS ! // "" ); // JHS ! fprintf(stderr, // JHS ! "Output will contain false trailing nulls.\n"); // JHS ! fprintf(stderr, // JHS ! "File: %s, Line %d, Ret %d\n", // JHS ! __FILE__, __LINE__, (int)bytes_read ); // JHS ! return(-1) ; // JHS ! // I've not read code to see if caller // JHS ! // appropriately detects & deals with -1 // JHS ! // But Ive tested it, with // JHS ! // tar cvf junk.tar aa bb, // JHS ! // & if aa has dev errors, // JHS ! // bb does not get archived. // JHS ! } // JHS ! } ! if (bytes_read < 0) // JHS ! { // JHS ! perror(NULL) ; // JHS ! fprintf(stderr,"File: %s, Line %d\n", // JHS ! __FILE__, __LINE__ ); // JHS ! return(-1) ; // JHS ! // I've not read code to see if caller // JHS ! // appropriately detects & deals with -1 // JHS ! } // JHS return 0; }