未验证 提交 46752101 编写于 作者: O openharmony_ci 提交者: Gitee

!572 修改updater service无法通过misc传递update信息的问题

Merge pull request !572 from hughes/master
......@@ -121,14 +121,16 @@ static int CheckAndRebootToUpdater(const char *valueData, const char *cmd,
INIT_ERROR_CHECK(ret == 0, return -1, "Failed to format cmd for %s.", cmd);
}
if ((cmdExt != NULL) && (valueData != NULL) && (strncmp(valueData, cmdExt, strlen(cmdExt)) == 0)) {
const char *p = valueData + strlen(cmdExt);
ret = snprintf_s(msg.update, MAX_UPDATE_SIZE, MAX_UPDATE_SIZE - 1, "%s", p);
INIT_ERROR_CHECK(ret > 0, return -1, "Failed to format param for %s.", cmd);
msg.update[MAX_UPDATE_SIZE - 1] = 0;
} else {
ret = memset_s(msg.update, MAX_UPDATE_SIZE, 0, MAX_UPDATE_SIZE);
INIT_ERROR_CHECK(ret == 0, return -1, "Failed to format update for %s.", cmd);
if (strncmp(cmd, "updater", strlen("updater")) != 0) {
if ((cmdExt != NULL) && (valueData != NULL) && (strncmp(valueData, cmdExt, strlen(cmdExt)) == 0)) {
const char *p = valueData + strlen(cmdExt);
ret = snprintf_s(msg.update, MAX_UPDATE_SIZE, MAX_UPDATE_SIZE - 1, "%s", p);
INIT_ERROR_CHECK(ret > 0, return -1, "Failed to format param for %s.", cmd);
msg.update[MAX_UPDATE_SIZE - 1] = 0;
} else {
ret = memset_s(msg.update, MAX_UPDATE_SIZE, 0, MAX_UPDATE_SIZE);
INIT_ERROR_CHECK(ret == 0, return -1, "Failed to format update for %s.", cmd);
}
}
if (RBMiscWriteUpdaterMessage(miscFile, &msg) == 0) {
......
......@@ -70,3 +70,4 @@
/dev/tty0 0660 0 1000
/dev/uinput 0660 3011 3011
/dev/access_token_id 0666 3020 3020
/dev/block/by-name/misc 0660 6666 6666
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册