libkms: return -EINVAL on fstat error

On error fstat return -1, instead return -EINVAL to caller

Signed-off-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
main
Maxime Villard 2013-01-02 10:57:07 -05:00 committed by Jerome Glisse
parent 1f4b5e11e6
commit baf0a7daaf
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ linux_name_from_sysfs(int fd, char **out)
ret = fstat(fd, &buffer);
if (ret)
return ret;
return -EINVAL;
if (!S_ISCHR(buffer.st_mode))
return -EINVAL;