Commit 7807c7c6 authored by Geoff Simmons's avatar Geoff Simmons

Print the stream name in the error message if dup2(2) fails.

parent c4f7869a
......@@ -145,7 +145,8 @@ mk_dup(int oldfd, int newfd)
{
errno = 0;
if (dup2(oldfd, newfd) == -1) {
fprintf(stderr, "dup2(2) failed: %s", vstrerror(errno));
fprintf(stderr, "dup2(2) failed for %s: %s", stream_name[newfd],
vstrerror(errno));
return (-1);
}
return (0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment