sensortest: modify errno type when api not support

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-07-20 17:13:47 +08:00 committed by Abdelatif Guettouche
parent b989c3d536
commit 293b89af44

View File

@ -277,7 +277,7 @@ int main(int argc, FAR char *argv[])
if (ret < 0) if (ret < 0)
{ {
ret = -errno; ret = -errno;
if (ret != -ENOTTY) if (ret != -ENOTSUP)
{ {
printf("Failed to set interval for sensor:%s, ret:%s\n", printf("Failed to set interval for sensor:%s, ret:%s\n",
devname, strerror(errno)); devname, strerror(errno));
@ -289,7 +289,7 @@ int main(int argc, FAR char *argv[])
if (ret < 0) if (ret < 0)
{ {
ret = -errno; ret = -errno;
if (ret != -ENOTTY) if (ret != -ENOTSUP)
{ {
printf("Failed to batch for sensor:%s, ret:%s\n", printf("Failed to batch for sensor:%s, ret:%s\n",
devname, strerror(errno)); devname, strerror(errno));
@ -301,7 +301,7 @@ int main(int argc, FAR char *argv[])
if (ret < 0) if (ret < 0)
{ {
ret = -errno; ret = -errno;
if (ret != -ENOTTY) if (ret != -ENOTSUP)
{ {
printf("Failed to enable sensor:%s, ret:%s\n", printf("Failed to enable sensor:%s, ret:%s\n",
devname, strerror(errno)); devname, strerror(errno));