mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
hurd: Fix getxattr("gnu.translator") returning ENODATA
When no translator is set, __file_get_translator would return EINVAL which is a confusing value. Better check for a passive translation before getting the value.
This commit is contained in:
parent
74f9ee3b91
commit
ba5a23422a
1 changed files with 10 additions and 1 deletions
11
hurd/xattr.c
11
hurd/xattr.c
|
@ -61,7 +61,16 @@ _hurd_xattr_get (io_t port, const char *name, void *value, size_t *size)
|
|||
{
|
||||
char *buf = value;
|
||||
mach_msg_type_number_t bufsz = value ? *size : 0;
|
||||
error_t err = __file_get_translator (port, &buf, &bufsz);
|
||||
struct stat64 st;
|
||||
error_t err;
|
||||
|
||||
err = __io_stat (port, &st);
|
||||
if (err)
|
||||
return err;
|
||||
if ((st.st_mode & S_IPTRANS) == 0)
|
||||
return ENODATA;
|
||||
|
||||
err = __file_get_translator (port, &buf, &bufsz);
|
||||
if (err)
|
||||
return err;
|
||||
if (value != NULL && *size < bufsz)
|
||||
|
|
Loading…
Add table
Reference in a new issue