Index: src/bin/dd/dd.c =================================================================== --- src/bin/dd/dd.c (revision 238763) +++ src/bin/dd/dd.c (working copy) @@ -116,6 +116,7 @@ { u_int cnt; struct timeval tv; + struct stat sb; if (in.name == NULL) { in.name = "stdin"; @@ -138,7 +139,11 @@ } else { #define OFLAGS \ (O_CREAT | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC)) - out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE); + + if (stat(out.name, &sb) != 0 || !S_ISFIFO(sb.st_mode)) + out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE); + else + out.fd = -1; /* * May not have read access, so try again with write only. * Without read we may have a problem if output also does