Use proper error message when fstat(2) fails on stdout.

PR:		bin/159746
Submitted by:	Alex K.
This commit is contained in:
jh 2012-07-20 08:33:23 +00:00
parent 0fdc094d92
commit c64014573d

View File

@ -260,7 +260,7 @@ raw_cat(int rfd)
wfd = fileno(stdout);
if (buf == NULL) {
if (fstat(wfd, &sbuf))
err(1, "%s", filename);
err(1, "stdout");
if (S_ISREG(sbuf.st_mode)) {
/* If there's plenty of RAM, use a large copy buffer */
if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD)