Treat fstat(2) failure (different than EBADF) as fatal error.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2011-02-06 14:07:58 +00:00
parent 18d6e1a5f6
commit ee3a876c18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218374

View File

@ -188,6 +188,7 @@ descriptors_assert(const struct hast_resource *res, int pjdlogmode)
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"Unable to fstat descriptor %d: %s", fd, "Unable to fstat descriptor %d: %s", fd,
strerror(errno)); strerror(errno));
break;
} }
if (fd == STDIN_FILENO || fd == STDOUT_FILENO || if (fd == STDIN_FILENO || fd == STDOUT_FILENO ||
fd == STDERR_FILENO) { fd == STDERR_FILENO) {