From f7c46039038f3c8ea225435400b724b9127e7d69 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Wed, 28 Feb 2024 11:12:26 +0800 Subject: [PATCH] =?UTF-8?q?sensorlite=204.1release=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bailu1992 --- frameworks/src/sensor_agent_proxy.c | 7 ++++--- services/src/sensor_service.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frameworks/src/sensor_agent_proxy.c b/frameworks/src/sensor_agent_proxy.c index 00f4756..0b2e988 100644 --- a/frameworks/src/sensor_agent_proxy.c +++ b/frameworks/src/sensor_agent_proxy.c @@ -130,7 +130,7 @@ int32_t GetSensorInfos(IOwner owner, IpcIo *reply) if (notify == NULL) { HILOG_ERROR(HILOG_MODULE_APP, "%s notify is null", __func__); return SENSOR_ERROR_INVALID_PARAM; - } else { + } else { ReadInt32(reply, &(notify->retCode)); if (notify->retCode < 0) { HILOG_ERROR(HILOG_MODULE_APP, "%s failed, retCode: %d", __func__, notify->retCode); @@ -153,8 +153,9 @@ int32_t GetSensorInfos(IOwner owner, IpcIo *reply) return SENSOR_ERROR_INVALID_PARAM; } for (int32_t i = 0; i < notify->count; i++) { - if (memcpy_s((*(notify->sensorInfo) + i), sizeof(SensorInfo), (sensorInfo + i), - sizeof(SensorInfo))) { + errno_t ret = memcpy_s((*(notify->sensorInfo) + i), sizeof(SensorInfo), (sensorInfo + i), + sizeof(SensorInfo)); + if (ret != EOK) { HILOG_ERROR(HILOG_MODULE_APP, "%s copy sensorInfo failed", __func__); free(*(notify->sensorInfo)); *(notify->sensorInfo) = NULL; diff --git a/services/src/sensor_service.c b/services/src/sensor_service.c index e04f215..1e75180 100755 --- a/services/src/sensor_service.c +++ b/services/src/sensor_service.c @@ -132,7 +132,7 @@ int32_t UnsubscribeSensorInvoke(SensorFeatureApi *defaultApi, IpcIo *req, IpcIo HILOG_ERROR(HILOG_MODULE_APP, "[SERVICE:%s]: %s failed, defaultApi is null", SENSOR_SERVICE, __func__); WriteInt32(reply, SENSOR_ERROR_UNKNOWN); return SENSOR_ERROR_UNKNOWN; - } else { + } else { SensorUser sensorUser; int32_t ret = defaultApi->UnsubscribeSensor(sensorId, &sensorUser); WriteInt32(reply, ret); -- Gitee