提交 1867ac1c 编写于 作者: X xionglei6

init: fix bugs

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 6790203a
......@@ -23,7 +23,10 @@ if (defined(ohos_lite)) {
"//base/startup/init_lite/interfaces/innerkits/include",
]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
defines = [ "_GNU_SOURCE" ]
defines = [
"_GNU_SOURCE",
"OHOS_LITE_WATCHDOG"
]
if (ohos_kernel_type == "linux") {
defines += [ "LINUX_WATCHDOG" ]
}
......
......@@ -79,9 +79,13 @@ int main(int argc, const char *argv[])
gap = (gap > 0) ? gap : DEFAULT_GAP;
INIT_LOGI("watchdoge started (interval %d, margin %d), fd = %d\n", interval, gap, fd);
#ifdef OHOS_LITE_WATCHDOG
#ifndef LINUX_WATCHDOG
if (setpriority(PRIO_PROCESS, 0, 14) != 0) { // 14 is process priority
INIT_LOGE("setpriority failed err=%d\n", errno);
}
#endif
#endif
int timeoutSet = interval + gap;
int timeoutGet = 0;
int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeoutSet);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册