[CRIU] [PATCH 06/14] pr_err(): don't forget a newline

Kir Kolyshkin kir at openvz.org
Tue Mar 21 15:00:58 PDT 2017


Unlike pr_perror(), pr_err() does not append a newline.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/arch/ppc64/src/lib/cpu.c    | 2 +-
 compel/arch/x86/src/lib/infect.c   | 2 +-
 compel/src/lib/infect.c            | 2 +-
 criu/arch/ppc64/cpu.c              | 4 ++--
 criu/arch/x86/include/asm/compat.h | 3 ++-
 criu/cgroup.c                      | 6 +++---
 criu/cr-restore.c                  | 6 +++---
 criu/crtools.c                     | 3 ++-
 criu/files-reg.c                   | 2 +-
 criu/filesystems.c                 | 2 +-
 criu/lsm.c                         | 4 ++--
 criu/mount.c                       | 2 +-
 criu/net.c                         | 2 +-
 criu/page-xfer.c                   | 2 +-
 criu/sockets.c                     | 2 +-
 criu/tty.c                         | 5 +++--
 criu/uffd.c                        | 2 +-
 17 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/compel/arch/ppc64/src/lib/cpu.c b/compel/arch/ppc64/src/lib/cpu.c
index d2a7552..24c3c0c 100644
--- a/compel/arch/ppc64/src/lib/cpu.c
+++ b/compel/arch/ppc64/src/lib/cpu.c
@@ -25,7 +25,7 @@ int compel_cpuid(compel_cpuinfo_t *info)
 	info->hwcap[1] = getauxval(AT_HWCAP2);
 
 	if (!info->hwcap[0] || !info->hwcap[1]) {
-		pr_err("Can't read the hardware capabilities");
+		pr_err("Can't read the hardware capabilities\n");
 		return -1;
 	}
 
diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index 23a96df..b64a55d 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -515,7 +515,7 @@ int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs)
 		return ret;
 	}
 
-	pr_err("PTRACE_GETREGSET read %zu bytes for pid %d, but native/compat regs sizes are %zu/%zu bytes",
+	pr_err("PTRACE_GETREGSET read %zu bytes for pid %d, but native/compat regs sizes are %zu/%zu bytes\n",
 			iov.iov_len, pid,
 			sizeof(regs->native), sizeof(regs->compat));
 	return -1;
diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index c34452f..c0b05e3 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -896,7 +896,7 @@ int compel_infect(struct parasite_ctl *ctl, unsigned long nr_threads, unsigned l
 
 	ret = arch_fetch_sas(ctl, ctl->rsigframe);
 	if (ret) {
-		pr_err("Can't fetch sigaltstack for task %d (ret %d)",
+		pr_err("Can't fetch sigaltstack for task %d (ret %d)\n",
 		       ctl->rpid, ret);
 		goto err;
 	}
diff --git a/criu/arch/ppc64/cpu.c b/criu/arch/ppc64/cpu.c
index aecba78..f90f997 100644
--- a/criu/arch/ppc64/cpu.c
+++ b/criu/arch/ppc64/cpu.c
@@ -68,13 +68,13 @@ int cpu_validate_cpuinfo(void)
                 goto error;
 
 	if (cpu_info->n_ppc64_entry != 1) {
-		pr_err("No PPC64 related entry in image");
+		pr_err("No PPC64 related entry in image\n");
 		goto error;
 	}
 	cpu_ppc64_entry = cpu_info->ppc64_entry[0];
 
 	if (cpu_ppc64_entry->endian != CURRENT_ENDIANNESS) {
-		pr_err("Bad endianness");
+		pr_err("Bad endianness\n");
 		goto error;
 	}
 
diff --git a/criu/arch/x86/include/asm/compat.h b/criu/arch/x86/include/asm/compat.h
index 119768d..6d20c93 100644
--- a/criu/arch/x86/include/asm/compat.h
+++ b/criu/arch/x86/include/asm/compat.h
@@ -30,7 +30,8 @@ static inline void free_compat_syscall_stack(void *mem)
 	long int ret = sys_munmap(mem, PAGE_SIZE);
 
 	if (ret)
-		pr_err("munmap() of compat addr %p failed with %ld", mem, ret);
+		pr_err("munmap() of compat addr %p failed with %ld\n",
+				mem, ret);
 }
 
 #ifdef CONFIG_COMPAT
diff --git a/criu/cgroup.c b/criu/cgroup.c
index a1b3eb2..b1c7b3d 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -422,12 +422,12 @@ static int add_cgroup_properties(const char *fpath, struct cgroup_dir *ncd,
 		const cgp_t *cgp = cgp_get_props(controller->controllers[i]);
 
 		if (dump_cg_props_array(fpath, ncd, cgp) < 0) {
-			pr_err("dumping known properties failed");
+			pr_err("dumping known properties failed\n");
 			return -1;
 		}
 
 		if (dump_cg_props_array(fpath, ncd, &cgp_global) < 0) {
-			pr_err("dumping global properties failed");
+			pr_err("dumping global properties failed\n");
 			return -1;
 		}
 	}
@@ -1069,7 +1069,7 @@ static int move_in_cgroup(CgSetEntry *se, bool setup_cgns)
 	pr_info("Move into %d\n", se->id);
 
 	if (setup_cgns && prepare_cgns(se) < 0) {
-		pr_err("failed preparing cgns");
+		pr_err("failed preparing cgns\n");
 		return -1;
 	}
 
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index d0a970b..8640c94 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -558,7 +558,7 @@ static int open_core(int pid, CoreEntry **pcore)
 
 	img = open_image(CR_FD_CORE, O_RSTR, pid);
 	if (!img) {
-		pr_err("Can't open core data for %d", pid);
+		pr_err("Can't open core data for %d\n", pid);
 		return -1;
 	}
 
@@ -1742,7 +1742,7 @@ static int prepare_userns_hook(void)
 		return -1;
 
 	if (prepare_loginuid(INVALID_UID, LOG_ERROR) < 0) {
-		pr_err("Setting loginuid for CT init task failed, CAP_AUDIT_CONTROL?");
+		pr_err("Setting loginuid for CT init task failed, CAP_AUDIT_CONTROL?\n");
 		return -1;
 	}
 	return 0;
@@ -1755,7 +1755,7 @@ static void restore_origin_ns_hook(void)
 
 	/* not critical: it does not affect CT in any way */
 	if (prepare_loginuid(saved_loginuid, LOG_ERROR) < 0)
-		pr_err("Restore original /proc/self/loginuid failed");
+		pr_err("Restore original /proc/self/loginuid failed\n");
 }
 
 static int write_restored_pid(void)
diff --git a/criu/crtools.c b/criu/crtools.c
index 927ca8e..5a039a8 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -572,7 +572,8 @@ int main(int argc, char *argv[], char *envp[])
 			if (!strcmp("net", optarg))
 				opts.empty_ns |= CLONE_NEWNET;
 			else {
-				pr_err("Unsupported empty namespace: %s", optarg);
+				pr_err("Unsupported empty namespace: %s\n",
+						optarg);
 				return 1;
 			}
 			break;
diff --git a/criu/files-reg.c b/criu/files-reg.c
index 3b93bb9..4514275 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1323,7 +1323,7 @@ static int make_parent_dirs_if_need(int mntns_root, char *path)
 
 	p = last_delim = strrchr(path, '/');
 	if (!p) {
-		pr_err("Path %s has no parent dir", path);
+		pr_err("Path %s has no parent dir\n", path);
 		return -1;
 	}
 	*p = '\0';
diff --git a/criu/filesystems.c b/criu/filesystems.c
index 5c8a0b7..8211e39 100644
--- a/criu/filesystems.c
+++ b/criu/filesystems.c
@@ -613,7 +613,7 @@ static bool btrfs_sb_equal(struct mount_info *a, struct mount_info *b)
 	bool equal;
 
 	if (!posa || !posb) {
-		pr_err("invalid btrfs options, no subvol argument");
+		pr_err("invalid btrfs options, no subvol argument\n");
 		return false;
 	}
 
diff --git a/criu/lsm.c b/criu/lsm.c
index 27ca004..8c014d4 100644
--- a/criu/lsm.c
+++ b/criu/lsm.c
@@ -192,7 +192,7 @@ int render_lsm_profile(char *profile, char **val)
 	switch (lsmtype) {
 	case LSMTYPE__APPARMOR:
 		if (strcmp(profile, "unconfined") != 0 && asprintf(val, "changeprofile %s", profile) < 0) {
-			pr_err("allocating lsm profile failed");
+			pr_err("allocating lsm profile failed\n");
 			*val = NULL;
 			return -1;
 		}
@@ -219,7 +219,7 @@ int parse_lsm_arg(char *arg)
 
 	aux = strchr(arg, ':');
 	if (aux == NULL) {
-		pr_err("invalid argument %s for --lsm-profile", arg);
+		pr_err("invalid argument %s for --lsm-profile\n", arg);
 		return -1;
 	}
 
diff --git a/criu/mount.c b/criu/mount.c
index 6e5a4c6..750e9f5 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -3217,7 +3217,7 @@ int collect_mnt_namespaces(bool for_dump)
 			if (ret == -EPERM)
 				pr_info("Can't mount binfmt_misc: EPERM. Running in user_ns?\n");
 			else if (ret < 0 && ret != -EBUSY && ret != -ENODEV && ret != -ENOENT) {
-				pr_err("Can't mount binfmt_misc: %d %s", ret, strerror(-ret));
+				pr_err("Can't mount binfmt_misc: %d %s\n", ret, strerror(-ret));
 				goto err;
 			} else if (ret == 0) {
 				ret = -1;
diff --git a/criu/net.c b/criu/net.c
index 45f6fce..c0f5b14 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -1750,7 +1750,7 @@ static int create_net_ns(void *arg)
 		exit(2);
 	}
 	if (prepare_userns_creds() < 0) {
-		pr_err("Can't prepare creds");
+		pr_err("Can't prepare creds\n");
 		exit(3);
 	}
 	close(ufd);
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index f018a8e..89ea94f 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -466,7 +466,7 @@ int check_parent_local_xfer(int fd_type, int id)
 
 	if (opts.remote) {
 		pfd = get_curr_parent_snapshot_id_idx();
-		pr_err("Unable to get parent snapsgot id");
+		pr_err("Unable to get parent snapshot id\n");
 		if (pfd == -1)
 			return -1;
 	} else {
diff --git a/criu/sockets.c b/criu/sockets.c
index 420eee8..5d006a3 100644
--- a/criu/sockets.c
+++ b/criu/sockets.c
@@ -760,7 +760,7 @@ int set_netns(uint32_t ns_id)
 
 	ns = lookup_ns_by_id(ns_id, &net_ns_desc);
 	if (ns == NULL) {
-		pr_err("Unable to find a network namespace");
+		pr_err("Unable to find a network namespace\n");
 		return -1;
 	}
 	nsfd = fdstore_get(ns->net.nsfd_id);
diff --git a/criu/tty.c b/criu/tty.c
index 0ff690c..d49aafd 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -2201,7 +2201,7 @@ int devpts_check_bindmount(struct mount_info *m)
 		return 0;
 
 	if (sscanf(m->root, "/%d", &index) != 1) {
-		pr_err("Unable to parse %s", m->root);
+		pr_err("Unable to parse %s\n", m->root);
 		return -1;
 	}
 
@@ -2234,7 +2234,8 @@ found:
 	}
 
 	if (master_mp->nsid->type != NS_ROOT) {
-		pr_err("The master for %s isn't from the root mntns", m->root);
+		pr_err("The master for %s isn't from the root mntns\n",
+				m->root);
 		return -1;
 	}
 
diff --git a/criu/uffd.c b/criu/uffd.c
index e455b53..6cee7ec 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -626,7 +626,7 @@ static int ud_open(int client, struct lazy_pages_info **_lpi)
 
 	lpi->lpfd.fd = recv_fd(client);
 	if (lpi->lpfd.fd < 0) {
-		pr_err("recv_fd error");
+		pr_err("recv_fd error\n");
 		goto out;
 	}
 	pr_debug("Received PID: %d, uffd: %d\n", lpi->pid, lpi->lpfd.fd);
-- 
2.9.3



More information about the CRIU mailing list