提交 4415d8a5 编写于 作者: W WANG Cong 提交者: Linus Torvalds

arch/um/os-Linux/sys-i386/task_size.c: improve a bit

Improve this code a bit: check sigaction's return value and remove a useless
fflush().
Acked-by: NJeff Dike <jdike@addtoit.com>
Signed-off-by: NWANG Cong <wangcong@zeuux.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 074a0db8
......@@ -88,7 +88,10 @@ unsigned long os_get_task_size(void)
sa.sa_handler = segfault;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_NODEFER;
sigaction(SIGSEGV, &sa, &old);
if (sigaction(SIGSEGV, &sa, &old)) {
perror("os_get_task_size");
exit(1);
}
if (!page_ok(bottom)) {
fprintf(stderr, "Address 0x%x no good?\n",
......@@ -110,11 +113,12 @@ unsigned long os_get_task_size(void)
out:
/* Restore the old SIGSEGV handling */
sigaction(SIGSEGV, &old, NULL);
if (sigaction(SIGSEGV, &old, NULL)) {
perror("os_get_task_size");
exit(1);
}
top <<= UM_KERN_PAGE_SHIFT;
printf("0x%x\n", top);
fflush(stdout);
return top;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册