Avoid wrong value from file-attributes on Linux kernel before 3.6
* dired.c (file_attributes): Handle unsupported fstat on O_PATH descriptors. (bug#29070)
This commit is contained in:
parent
70621e2571
commit
8453423c7c
1 changed files with 8 additions and 1 deletions
|
@ -953,7 +953,14 @@ file_attributes (int fd, char const *name,
|
||||||
{
|
{
|
||||||
record_unwind_protect_int (close_file_unwind, namefd);
|
record_unwind_protect_int (close_file_unwind, namefd);
|
||||||
if (fstat (namefd, &s) != 0)
|
if (fstat (namefd, &s) != 0)
|
||||||
err = errno;
|
{
|
||||||
|
err = errno;
|
||||||
|
/* The Linux kernel before version 3.6 does not support
|
||||||
|
fstat on O_PATH file descriptors. Handle this error like
|
||||||
|
missing support for O_PATH. */
|
||||||
|
if (err == EBADF)
|
||||||
|
err = EINVAL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue