gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (04/02/85)
The UNIX System V Release 2.0 "tar" has introduced a new bug as a side-effect of attempting to handle both old and new styles of magtape device names. The bug shows up when creating an ordinary archive file that does not already exist; "tar" attempts to open the magtape drive! The two lines below involving `usefil1' and `NULL' are my kludge to avoid the problem: /* @(#)tar.c 1.7 */ ... main(argc, argv) ... switch(*cp) { case 'f': usefile = *argv++; usefil1 = NULL; /* DAG -- part of bug fix (added) */ if (nblock == 1) nblock = 0; break; ... if (rflag) { ... if (strcmp(usefile, "-") == 0) { ... } else if ((mt = open(usefile,2)) < 0 && /* DAG -- bug fix: */ (usefil1 == NULL || (mt = open(usefil1,2)) < 0)) { if (cflag == 0 || (mt = creat(usefile, 0666)) < 0) { fprintf(stderr, "tar: cannot open %s\n", usefile); done(1); } } ...