Commit 921dbf23 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

Don't use \Newline in pr_perror

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4eac6c9e
...@@ -374,7 +374,7 @@ static int restore_priv_vma_content(pid_t pid) ...@@ -374,7 +374,7 @@ static int restore_priv_vma_content(pid_t pid)
ret = madvise(addr + PAGE_SIZE * i, ret = madvise(addr + PAGE_SIZE * i,
PAGE_SIZE, MADV_DONTNEED); PAGE_SIZE, MADV_DONTNEED);
if (ret < 0) { if (ret < 0) {
pr_perror("madvise failed\n"); pr_perror("madvise failed");
return -1; return -1;
} }
i++; i++;
...@@ -1190,7 +1190,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts) ...@@ -1190,7 +1190,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts)
ret = sigaction(SIGCHLD, NULL, &act); ret = sigaction(SIGCHLD, NULL, &act);
if (ret < 0) { if (ret < 0) {
pr_perror("sigaction() failed\n"); pr_perror("sigaction() failed");
return -1; return -1;
} }
...@@ -1201,7 +1201,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts) ...@@ -1201,7 +1201,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts)
ret = sigaction(SIGCHLD, &act, &old_act); ret = sigaction(SIGCHLD, &act, &old_act);
if (ret < 0) { if (ret < 0) {
pr_perror("sigaction() failed\n"); pr_perror("sigaction() failed");
return -1; return -1;
} }
...@@ -1257,7 +1257,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts) ...@@ -1257,7 +1257,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts)
/* Restore SIGCHLD here to skip SIGCHLD from a network sctip */ /* Restore SIGCHLD here to skip SIGCHLD from a network sctip */
ret = sigaction(SIGCHLD, &old_act, NULL); ret = sigaction(SIGCHLD, &old_act, NULL);
if (ret < 0) { if (ret < 0) {
pr_perror("sigaction() failed\n"); pr_perror("sigaction() failed");
goto out; goto out;
} }
...@@ -1747,7 +1747,7 @@ static int open_signal_image(int type, pid_t pid, siginfo_t **ptr, ...@@ -1747,7 +1747,7 @@ static int open_signal_image(int type, pid_t pid, siginfo_t **ptr,
else else
*ptr = mremap(*ptr, *size, new_size, MREMAP_MAYMOVE); *ptr = mremap(*ptr, *size, new_size, MREMAP_MAYMOVE);
if (*ptr == MAP_FAILED) { if (*ptr == MAP_FAILED) {
pr_perror("Can't allocate memory for siginfo-s\n"); pr_perror("Can't allocate memory for siginfo-s");
ret = -1; ret = -1;
break; break;
} }
......
...@@ -92,7 +92,7 @@ static int open_remap_ghost(struct reg_file_info *rfi, ...@@ -92,7 +92,7 @@ static int open_remap_ghost(struct reg_file_info *rfi,
if (S_ISFIFO(gfe->mode)) { if (S_ISFIFO(gfe->mode)) {
if (mknod(gf->remap.path, gfe->mode, 0)) { if (mknod(gf->remap.path, gfe->mode, 0)) {
pr_perror("Can't create node for ghost file\n"); pr_perror("Can't create node for ghost file");
goto close_ifd; goto close_ifd;
} }
ghost_flags = O_RDWR; /* To not block */ ghost_flags = O_RDWR; /* To not block */
...@@ -106,7 +106,7 @@ static int open_remap_ghost(struct reg_file_info *rfi, ...@@ -106,7 +106,7 @@ static int open_remap_ghost(struct reg_file_info *rfi,
} }
if (fchown(gfd, gfe->uid, gfe->gid) < 0) { if (fchown(gfd, gfe->uid, gfe->gid) < 0) {
pr_perror("Can't reset user/group on ghost %#x\n", rfe->remap_id); pr_perror("Can't reset user/group on ghost %#x", rfe->remap_id);
goto close_all; goto close_all;
} }
...@@ -493,7 +493,7 @@ static int open_path(struct file_desc *d, ...@@ -493,7 +493,7 @@ static int open_path(struct file_desc *d,
if (rfi->remap) { if (rfi->remap) {
mutex_lock(ghost_file_mutex); mutex_lock(ghost_file_mutex);
if (link(rfi->remap->path, rfi->path) < 0) { if (link(rfi->remap->path, rfi->path) < 0) {
pr_perror("Can't link %s -> %s\n", pr_perror("Can't link %s -> %s",
rfi->remap->path, rfi->path); rfi->remap->path, rfi->path);
return -1; return -1;
} }
......
...@@ -141,7 +141,7 @@ static int fill_fd_params(struct parasite_ctl *ctl, int fd, int lfd, ...@@ -141,7 +141,7 @@ static int fill_fd_params(struct parasite_ctl *ctl, int fd, int lfd,
int ret; int ret;
if (fstat(lfd, &p->stat) < 0) { if (fstat(lfd, &p->stat) < 0) {
pr_perror("Can't stat fd %d\n", lfd); pr_perror("Can't stat fd %d", lfd);
return -1; return -1;
} }
...@@ -164,7 +164,7 @@ static int fill_fd_params(struct parasite_ctl *ctl, int fd, int lfd, ...@@ -164,7 +164,7 @@ static int fill_fd_params(struct parasite_ctl *ctl, int fd, int lfd,
ret = fcntl(lfd, F_GETSIG, 0); ret = fcntl(lfd, F_GETSIG, 0);
if (ret < 0) { if (ret < 0) {
pr_perror("Can't get owner signum on %d\n", lfd); pr_perror("Can't get owner signum on %d", lfd);
return -1; return -1;
} }
p->fown.signum = ret; p->fown.signum = ret;
...@@ -225,7 +225,7 @@ static int dump_one_file(struct parasite_ctl *ctl, int fd, int lfd, struct fd_op ...@@ -225,7 +225,7 @@ static int dump_one_file(struct parasite_ctl *ctl, int fd, int lfd, struct fd_op
return dump_chrdev(&p, lfd, fdinfo); return dump_chrdev(&p, lfd, fdinfo);
if (fstatfs(lfd, &statfs)) { if (fstatfs(lfd, &statfs)) {
pr_perror("Can't obtain statfs on fd %d\n", fd); pr_perror("Can't obtain statfs on fd %d", fd);
return -1; return -1;
} }
......
...@@ -187,13 +187,13 @@ int cr_page_server(void) ...@@ -187,13 +187,13 @@ int cr_page_server(void)
sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sk < 0) { if (sk < 0) {
pr_perror("Can't init page server\n"); pr_perror("Can't init page server");
return -1; return -1;
} }
opts.ps_addr.sin_family = AF_INET; opts.ps_addr.sin_family = AF_INET;
if (bind(sk, (struct sockaddr *)&opts.ps_addr, sizeof(opts.ps_addr))) { if (bind(sk, (struct sockaddr *)&opts.ps_addr, sizeof(opts.ps_addr))) {
pr_perror("Can't bind page server\n"); pr_perror("Can't bind page server");
goto out; goto out;
} }
...@@ -232,14 +232,14 @@ int connect_to_page_server(void) ...@@ -232,14 +232,14 @@ int connect_to_page_server(void)
page_server_sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); page_server_sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (page_server_sk < 0) { if (page_server_sk < 0) {
pr_perror("Can't create socket\n"); pr_perror("Can't create socket");
return -1; return -1;
} }
opts.ps_addr.sin_family = AF_INET; opts.ps_addr.sin_family = AF_INET;
if (connect(page_server_sk, (struct sockaddr *)&opts.ps_addr, if (connect(page_server_sk, (struct sockaddr *)&opts.ps_addr,
sizeof(opts.ps_addr)) < 0) { sizeof(opts.ps_addr)) < 0) {
pr_perror("Can't connect to server\n"); pr_perror("Can't connect to server");
return -1; return -1;
} }
...@@ -257,7 +257,7 @@ static int write_pagemap_to_server(struct page_xfer *xfer, ...@@ -257,7 +257,7 @@ static int write_pagemap_to_server(struct page_xfer *xfer,
pi.nr_pages = iov->iov_len / PAGE_SIZE; pi.nr_pages = iov->iov_len / PAGE_SIZE;
if (write(xfer->fd, &pi, sizeof(pi)) != sizeof(pi)) { if (write(xfer->fd, &pi, sizeof(pi)) != sizeof(pi)) {
pr_perror("Can't write pagemap to server\n"); pr_perror("Can't write pagemap to server");
return -1; return -1;
} }
...@@ -287,7 +287,7 @@ static int write_hole_to_server(struct page_xfer *xfer, struct iovec *iov) ...@@ -287,7 +287,7 @@ static int write_hole_to_server(struct page_xfer *xfer, struct iovec *iov)
pi.nr_pages = iov->iov_len / PAGE_SIZE; pi.nr_pages = iov->iov_len / PAGE_SIZE;
if (write(xfer->fd, &pi, sizeof(pi)) != sizeof(pi)) { if (write(xfer->fd, &pi, sizeof(pi)) != sizeof(pi)) {
pr_perror("Can't write pagehole to server\n"); pr_perror("Can't write pagehole to server");
return -1; return -1;
} }
......
...@@ -1048,7 +1048,7 @@ int parse_fdinfo(int fd, int type, ...@@ -1048,7 +1048,7 @@ int parse_fdinfo(int fd, int type,
pr_err("No records of type %d found in fdinfo file\n", type); pr_err("No records of type %d found in fdinfo file\n", type);
parse_err: parse_err:
ret = -1; ret = -1;
pr_perror("%s: error parsing [%s] for %d\n", __func__, str, type); pr_perror("%s: error parsing [%s] for %d", __func__, str, type);
out: out:
fclose(f); fclose(f);
return ret; return ret;
......
...@@ -81,7 +81,7 @@ int dump_sk_queue(int sock_fd, int sock_id) ...@@ -81,7 +81,7 @@ int dump_sk_queue(int sock_fd, int sock_id)
orig_peek_off = 0; orig_peek_off = 0;
ret = getsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &orig_peek_off, &tmp); ret = getsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &orig_peek_off, &tmp);
if (ret < 0) { if (ret < 0) {
pr_perror("getsockopt failed\n"); pr_perror("getsockopt failed");
return ret; return ret;
} }
/* /*
...@@ -91,7 +91,7 @@ int dump_sk_queue(int sock_fd, int sock_id) ...@@ -91,7 +91,7 @@ int dump_sk_queue(int sock_fd, int sock_id)
size = 0; size = 0;
ret = getsockopt(sock_fd, SOL_SOCKET, SO_SNDBUF, &size, &tmp); ret = getsockopt(sock_fd, SOL_SOCKET, SO_SNDBUF, &size, &tmp);
if (ret < 0) { if (ret < 0) {
pr_perror("getsockopt failed\n"); pr_perror("getsockopt failed");
return ret; return ret;
} }
...@@ -110,7 +110,7 @@ int dump_sk_queue(int sock_fd, int sock_id) ...@@ -110,7 +110,7 @@ int dump_sk_queue(int sock_fd, int sock_id)
*/ */
ret = setsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &ret, sizeof(int)); ret = setsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &ret, sizeof(int));
if (ret < 0) { if (ret < 0) {
pr_perror("setsockopt fail\n"); pr_perror("setsockopt fail");
goto err_brk; goto err_brk;
} }
...@@ -130,7 +130,7 @@ int dump_sk_queue(int sock_fd, int sock_id) ...@@ -130,7 +130,7 @@ int dump_sk_queue(int sock_fd, int sock_id)
if (ret < 0) { if (ret < 0) {
if (errno == EAGAIN) if (errno == EAGAIN)
break; /* we're done */ break; /* we're done */
pr_perror("recvmsg fail: error\n"); pr_perror("recvmsg fail: error");
goto err_set_sock; goto err_set_sock;
} }
if (msg.msg_flags & MSG_TRUNC) { if (msg.msg_flags & MSG_TRUNC) {
...@@ -162,7 +162,7 @@ err_set_sock: ...@@ -162,7 +162,7 @@ err_set_sock:
* Restore original peek offset. * Restore original peek offset.
*/ */
if (setsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &orig_peek_off, sizeof(int))) { if (setsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &orig_peek_off, sizeof(int))) {
pr_perror("setsockopt failed on restore\n"); pr_perror("setsockopt failed on restore");
ret = -1; ret = -1;
} }
err_brk: err_brk:
......
...@@ -563,7 +563,7 @@ int rst_tcp_socks_remap(void *addr) ...@@ -563,7 +563,7 @@ int rst_tcp_socks_remap(void *addr)
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
if (ret != addr) { if (ret != addr) {
pr_perror("mmap() failed\n"); pr_perror("mmap() failed");
return -1; return -1;
} }
...@@ -628,7 +628,7 @@ int check_tcp(void) ...@@ -628,7 +628,7 @@ int check_tcp(void)
sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sk < 0) { if (sk < 0) {
pr_perror("Can't create TCP socket :(\n"); pr_perror("Can't create TCP socket :(");
return -1; return -1;
} }
......
...@@ -192,7 +192,7 @@ static int dump_socket_filter(int sk, SkOptsEntry *soe) ...@@ -192,7 +192,7 @@ static int dump_socket_filter(int sk, SkOptsEntry *soe)
ret = getsockopt(sk, SOL_SOCKET, SO_GET_FILTER, flt, &len); ret = getsockopt(sk, SOL_SOCKET, SO_GET_FILTER, flt, &len);
if (ret) { if (ret) {
pr_perror("Can't get socket filter\n"); pr_perror("Can't get socket filter");
xfree(flt); xfree(flt);
return ret; return ret;
} }
......
...@@ -200,7 +200,7 @@ static int parse_index(u32 id, int lfd, int major) ...@@ -200,7 +200,7 @@ static int parse_index(u32 id, int lfd, int major)
switch (major) { switch (major) {
case TTYAUX_MAJOR: case TTYAUX_MAJOR:
if (ioctl(lfd, TIOCGPTN, &index)) { if (ioctl(lfd, TIOCGPTN, &index)) {
pr_perror("Can't obtain ptmx index\n"); pr_perror("Can't obtain ptmx index");
return -1; return -1;
} }
break; break;
...@@ -328,7 +328,7 @@ static int lock_pty(int fd) ...@@ -328,7 +328,7 @@ static int lock_pty(int fd)
static int tty_set_sid(int fd) static int tty_set_sid(int fd)
{ {
if (ioctl(fd, TIOCSCTTY, 1)) { if (ioctl(fd, TIOCSCTTY, 1)) {
pr_perror("Can't set sid on terminal fd %d\n", fd); pr_perror("Can't set sid on terminal fd %d", fd);
return -1; return -1;
} }
...@@ -338,7 +338,7 @@ static int tty_set_sid(int fd) ...@@ -338,7 +338,7 @@ static int tty_set_sid(int fd)
static int tty_set_prgp(int fd, int group) static int tty_set_prgp(int fd, int group)
{ {
if (ioctl(fd, TIOCSPGRP, &group)) { if (ioctl(fd, TIOCSPGRP, &group)) {
pr_perror("Failed to set group %d on %d\n", group, fd); pr_perror("Failed to set group %d on %d", group, fd);
return -1; return -1;
} }
return 0; return 0;
......
...@@ -361,7 +361,7 @@ int clone_service_fd(int id) ...@@ -361,7 +361,7 @@ int clone_service_fd(int id)
if (ret == -1) { if (ret == -1) {
if (errno == EBADF) if (errno == EBADF)
continue; continue;
pr_perror("Unable to clone %d->%d\n", old, new); pr_perror("Unable to clone %d->%d", old, new);
} }
} }
...@@ -495,7 +495,7 @@ int run_scripts(char *action) ...@@ -495,7 +495,7 @@ int run_scripts(char *action)
int ret = 0; int ret = 0;
if (setenv("CRTOOLS_SCRIPT_ACTION", action, 1)) { if (setenv("CRTOOLS_SCRIPT_ACTION", action, 1)) {
pr_perror("Can't set CRTOOL_SCRIPT_ACTION=%s\n", action); pr_perror("Can't set CRTOOL_SCRIPT_ACTION=%s", action);
return -1; return -1;
} }
...@@ -536,7 +536,7 @@ int cr_system(int in, int out, int err, char *cmd, char *const argv[]) ...@@ -536,7 +536,7 @@ int cr_system(int in, int out, int err, char *cmd, char *const argv[])
pid = fork(); pid = fork();
if (pid == -1) { if (pid == -1) {
pr_perror("fork() failed\n"); pr_perror("fork() failed");
goto out; goto out;
} else if (pid == 0) { } else if (pid == 0) {
if (out < 0) if (out < 0)
......
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