Skip to content

Commit

Permalink
um: Use printk instead of printf in make_uml_dir
Browse files Browse the repository at this point in the history
Since this function will be called after printk buffer
initialized, use printk as other functions do.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Masami Hiramatsu authored and Richard Weinberger committed Jul 5, 2017
1 parent 32c1431 commit e03c78a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions arch/um/os-Linux/umid.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ static int __init make_uml_dir(void)

err = -ENOENT;
if (home == NULL) {
printk(UM_KERN_ERR "make_uml_dir : no value in "
"environment for $HOME\n");
printk(UM_KERN_ERR
"%s: no value in environment for $HOME\n",
__func__);
goto err;
}
strlcpy(dir, home, sizeof(dir));
Expand All @@ -50,13 +51,15 @@ static int __init make_uml_dir(void)
err = -ENOMEM;
uml_dir = malloc(strlen(dir) + 1);
if (uml_dir == NULL) {
printf("make_uml_dir : malloc failed, errno = %d\n", errno);
printk(UM_KERN_ERR "%s : malloc failed, errno = %d\n",
__func__, errno);
goto err;
}
strcpy(uml_dir, dir);

if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
printk(UM_KERN_ERR "Failed to mkdir '%s': %s\n",
uml_dir, strerror(errno));
err = -errno;
goto err_free;
}
Expand Down

0 comments on commit e03c78a

Please sign in to comment.