From 8e03f213e330d50f14309f706f0932eb96fe5d7f Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Wed, 15 Jun 2022 21:26:09 +0800 Subject: [PATCH] driver/sensor: convert interval 0 to ULONG_MAX Signed-off-by: Jiuzhu Dong --- drivers/sensors/sensor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c index 41717cb9bb..e054116a8d 100644 --- a/drivers/sensors/sensor.c +++ b/drivers/sensors/sensor.c @@ -647,7 +647,8 @@ static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_SET_INTERVAL: { nxrmutex_lock(&upper->lock); - ret = sensor_update_interval(filep, upper, user, arg); + ret = sensor_update_interval(filep, upper, user, + arg ? arg : ULONG_MAX); nxrmutex_unlock(&upper->lock); } break;