Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!mahendo!wlbr!news From: sms@wlv.imsd.contel.com (Steven M. Schultz) Newsgroups: comp.bugs.2bsd Subject: dd exit status bug (+fix) Message-ID: <1991May5.080445.15466@wlbr.imsd.contel.com> Date: 5 May 91 08:04:45 GMT Sender: news@wlbr.imsd.contel.com (news) Organization: Contel Federal Systems Lines: 95 Nntp-Posting-Host: wlv.imsd.contel.com File: /usr/src/bin/dd.c Description: When dd(1) is writing an archive to tape, and encounters a write error or even an end of tape mark, it returns exit status 0, which spoils error checking in scripts and especially if it is the last command in a list. Repeat-By: try it; or inspect code to see that term() always exits with zero. Fix: Apply the following patch and recompile 'dd'. *** dd.c.old Sun Feb 8 14:24:49 1987 --- dd.c Sun Mar 31 00:23:49 1991 *************** *** 313,319 **** perror("read"); if((cflag&NERR) == 0) { flsh(); ! term(); } ibc = 0; for(c=0; c