Commit b17962ad authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

Fix pr_perror() usage

When using pr_perror(), format string should not end with \n,
as it is added by the macro itself.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@odin.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent de9df910
...@@ -649,12 +649,12 @@ static int check_aio_remap(void) ...@@ -649,12 +649,12 @@ static int check_aio_remap(void)
naddr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); naddr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0);
if (naddr == MAP_FAILED) { if (naddr == MAP_FAILED) {
pr_perror("Can't find place for new AIO ring\n"); pr_perror("Can't find place for new AIO ring");
return -1; return -1;
} }
if (mremap((void *)ctx, len, len, MREMAP_FIXED | MREMAP_MAYMOVE, naddr) == MAP_FAILED) { if (mremap((void *)ctx, len, len, MREMAP_FIXED | MREMAP_MAYMOVE, naddr) == MAP_FAILED) {
pr_perror("Can't remap AIO ring\n"); pr_perror("Can't remap AIO ring");
return -1; return -1;
} }
......
...@@ -526,7 +526,7 @@ static int restore_one_fanotify(int fd, struct fsnotify_mark_info *mark) ...@@ -526,7 +526,7 @@ static int restore_one_fanotify(int fd, struct fsnotify_mark_info *mark)
target = openat(mntns_root, m->mountpoint, O_PATH); target = openat(mntns_root, m->mountpoint, O_PATH);
if (target == -1) { if (target == -1) {
pr_perror("Unable to open %s\n", m->mountpoint); pr_perror("Unable to open %s", m->mountpoint);
goto err; goto err;
} }
......
...@@ -286,7 +286,7 @@ int kerndat_fdinfo_has_lock() ...@@ -286,7 +286,7 @@ int kerndat_fdinfo_has_lock()
} }
if (flock(fd, LOCK_SH)) { if (flock(fd, LOCK_SH)) {
pr_perror("Can't take a lock\n"); pr_perror("Can't take a lock");
return -1; return -1;
} }
......
...@@ -2595,7 +2595,7 @@ int prepare_mnt_ns(void) ...@@ -2595,7 +2595,7 @@ int prepare_mnt_ns(void)
/* Unprivileged users can't reveal what is under a mount */ /* Unprivileged users can't reveal what is under a mount */
if (root_ns_mask & CLONE_NEWUSER) { if (root_ns_mask & CLONE_NEWUSER) {
if (mount(opts.root, opts.root, NULL, MS_BIND | MS_REC, NULL)) { if (mount(opts.root, opts.root, NULL, MS_BIND | MS_REC, NULL)) {
pr_perror("Can't remount bind-mount %s into itself\n", opts.root); pr_perror("Can't remount bind-mount %s into itself", opts.root);
return -1; return -1;
} }
} }
......
...@@ -607,7 +607,7 @@ static int check_user_ns(int pid) ...@@ -607,7 +607,7 @@ static int check_user_ns(int pid)
chld = fork(); chld = fork();
if (chld == -1) { if (chld == -1) {
pr_perror("Unable to fork a process\n"); pr_perror("Unable to fork a process");
return -1; return -1;
} }
...@@ -829,7 +829,7 @@ static int write_id_map(pid_t pid, UidGidExtent **extents, int n, char *id_map) ...@@ -829,7 +829,7 @@ static int write_id_map(pid_t pid, UidGidExtent **extents, int n, char *id_map)
if (fd < 0) if (fd < 0)
return -1; return -1;
if (write(fd, buf, off) != off) { if (write(fd, buf, off) != off) {
pr_perror("Unable to write into %s\n", id_map); pr_perror("Unable to write into %s", id_map);
close(fd); close(fd);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment