提交 6790203a 编写于 作者: X xionglei6

init: fix watcher_dog

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 779e1987
......@@ -15,13 +15,17 @@
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include "sched.h"
#ifdef LINUX_WATCHDOG
#include <linux/watchdog.h>
#else
......@@ -75,7 +79,9 @@ 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);
if (setpriority(PRIO_PROCESS, 0, 14) != 0) { // 14 is process priority
INIT_LOGE("setpriority failed err=%d\n", errno);
}
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.
先完成此消息的编辑!
想要评论请 注册