From 91011328fa974a236dbdab03d5f33c5d65616bf4 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 14 Jan 2014 09:33:19 +0400 Subject: [PATCH] criu: Several formatting fixes Signed-off-by: Pavel Emelyanov --- cr-dedup.c | 4 ++-- cr-dump.c | 2 +- cr-exec.c | 2 +- cr-show.c | 2 +- image.c | 2 +- include/list.h | 2 +- mount.c | 2 +- page-xfer.c | 1 + pie/parasite.c | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cr-dedup.c b/cr-dedup.c index de69c5e24..d407974ea 100644 --- a/cr-dedup.c +++ b/cr-dedup.c @@ -115,8 +115,8 @@ int dedup_one_iovec(struct page_read *pr, struct iovec *iov) unsigned long piov_end; ret = seek_pagemap_page(pr, off, false); if (ret == -1) { - if(off < pr->cvaddr) { - if(pr->cvaddr < iov_end) + if (off < pr->cvaddr) { + if (pr->cvaddr < iov_end) off = pr->cvaddr; else return 0; diff --git a/cr-dump.c b/cr-dump.c index e02e4ae03..66a5913ad 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -1417,7 +1417,7 @@ static int dump_one_task(struct pstree_item *item) } ret = parse_posix_timers(pid, &proc_args); - if (ret < 0){ + if (ret < 0) { pr_err("Can't read posix timers file (pid: %d)\n", pid); goto err; } diff --git a/cr-exec.c b/cr-exec.c index 987fe5b5e..362371101 100644 --- a/cr-exec.c +++ b/cr-exec.c @@ -49,7 +49,7 @@ static int execute_syscall(struct parasite_ctl *ctl, * @ -- ret-arg of size */ - if ((opt[i][0] == '&') || (opt[i][0] == '@')){ + if ((opt[i][0] == '&') || (opt[i][0] == '@')) { int len; if (!r_mem) { diff --git a/cr-show.c b/cr-show.c index c1314d0dd..a128b95e6 100644 --- a/cr-show.c +++ b/cr-show.c @@ -478,7 +478,7 @@ static int cr_show_pid(int pid) PstreeEntry *pe; ret = pb_read_one_eof(fd, &pe, PB_PSTREE); - if (ret <= 0){ + if (ret <= 0) { close(fd); return ret; } diff --git a/image.c b/image.c index 79cc4ea4f..105584b4a 100644 --- a/image.c +++ b/image.c @@ -71,7 +71,7 @@ int write_img_inventory(void) crt.state = TASK_ALIVE; crt.pid.real = getpid(); - if (get_task_ids(&crt)){ + if (get_task_ids(&crt)) { close(fd); return -1; } diff --git a/include/list.h b/include/list.h index 32d8edd42..ce3a3c0cd 100644 --- a/include/list.h +++ b/include/list.h @@ -366,7 +366,7 @@ static inline void hlist_add_after(struct hlist_node *n, n->next = next; next->pprev = &n->next; - if(next->next) + if (next->next) next->next->pprev = &next->next; } diff --git a/mount.c b/mount.c index b7e5b4baa..c136c7f1e 100644 --- a/mount.c +++ b/mount.c @@ -1507,7 +1507,7 @@ int mntns_collect_root(pid_t pid) pfd = open_pid_proc(pid); ret = readlinkat(pfd, "root", path, sizeof(path) - 1); - if (ret < 0){ + if (ret < 0) { close_pid_proc(); return ret; } diff --git a/page-xfer.c b/page-xfer.c index 910acbdf5..c8adfd6c1 100644 --- a/page-xfer.c +++ b/page-xfer.c @@ -560,6 +560,7 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id) if (opts.auto_dedup && !opts.use_page_server) { int ret; int pfd; + pfd = openat(get_service_fd(IMG_FD_OFF), CR_PARENT_LINK, O_RDONLY); if (pfd < 0 && errno == ENOENT) goto out; diff --git a/pie/parasite.c b/pie/parasite.c index 7378df57d..372a6044b 100644 --- a/pie/parasite.c +++ b/pie/parasite.c @@ -121,7 +121,7 @@ static int dump_posix_timers(struct parasite_dump_posix_timers_args *args) int i; int ret = 0; - for(i = 0; i < args->timer_n; i++){ + for(i = 0; i < args->timer_n; i++) { ret = sys_timer_gettime(args->timer[i].it_id, &args->timer[i].val); if (ret < 0) { pr_err("sys_timer_gettime failed (%d)\n", ret);