um: Use os_info for the messages on normal path

Use os_info() for printing out the messages on the
normal execution path.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Masami Hiramatsu
2017-05-18 02:17:14 +09:00
committed by Richard Weinberger
parent f7887ee110
commit d3878bb800
4 changed files with 28 additions and 27 deletions

View File

@@ -25,13 +25,13 @@ static int __init check_tmpfs(const char *dir)
{
struct statfs st;
printf("Checking if %s is on tmpfs...", dir);
os_info("Checking if %s is on tmpfs...", dir);
if (statfs(dir, &st) < 0) {
printf("%s\n", strerror(errno));
os_info("%s\n", strerror(errno));
} else if (st.f_type != TMPFS_MAGIC) {
printf("no\n");
os_info("no\n");
} else {
printf("OK\n");
os_info("OK\n");
return 0;
}
return -1;
@@ -61,18 +61,18 @@ static char * __init choose_tempdir(void)
int i;
const char *dir;
printf("Checking environment variables for a tempdir...");
os_info("Checking environment variables for a tempdir...");
for (i = 0; vars[i]; i++) {
dir = getenv(vars[i]);
if ((dir != NULL) && (*dir != '\0')) {
printf("%s\n", dir);
os_info("%s\n", dir);
if (check_tmpfs(dir) >= 0)
goto done;
else
goto warn;
}
}
printf("none found\n");
os_info("none found\n");
for (i = 0; tmpfs_dirs[i]; i++) {
dir = tmpfs_dirs[i];
@@ -194,7 +194,7 @@ void __init check_tmpexec(void)
addr = mmap(NULL, UM_KERN_PAGE_SIZE,
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
printf("Checking PROT_EXEC mmap in %s...", tempdir);
os_info("Checking PROT_EXEC mmap in %s...", tempdir);
if (addr == MAP_FAILED) {
err = errno;
printf("%s\n", strerror(err));
@@ -203,7 +203,7 @@ void __init check_tmpexec(void)
printf("%s must be not mounted noexec\n", tempdir);
exit(1);
}
printf("OK\n");
os_info("OK\n");
munmap(addr, UM_KERN_PAGE_SIZE);
close(fd);