[CRIU] [PATCH 2/3] test/zdtm: use pr_err() not pr_perror

Kir Kolyshkin kir at openvz.org
Fri Nov 18 11:41:30 PST 2016


In places where we are not supposed to print errno, or where
we already print in explicitly, use pr_err().

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 test/zdtm/static/autofs.c                     | 2 +-
 test/zdtm/static/clone_fs.c                   | 6 +++---
 test/zdtm/static/mntns_shared_vs_private.c    | 2 +-
 test/zdtm/static/seccomp_filter_inheritance.c | 2 +-
 test/zdtm/static/seccomp_filter_tsync.c       | 2 +-
 test/zdtm/transition/shmem.c                  | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c
index 6a92826..e07e69f 100644
--- a/test/zdtm/static/autofs.c
+++ b/test/zdtm/static/autofs.c
@@ -638,7 +638,7 @@ static int reap_child(struct autofs_params *p)
 	}
 
 	if (WIFSIGNALED(status)) {
-		pr_perror("Kid was killed by %d\n", WTERMSIG(status));
+		pr_err("Child was killed by %d\n", WTERMSIG(status));
 		return -1;
 	}
 
diff --git a/test/zdtm/static/clone_fs.c b/test/zdtm/static/clone_fs.c
index 1db7371..5cebea5 100644
--- a/test/zdtm/static/clone_fs.c
+++ b/test/zdtm/static/clone_fs.c
@@ -34,13 +34,13 @@ static int kcmp(int type, pid_t pid1, pid_t pid2, unsigned long idx1, unsigned l
 			test_msg("FS for pids %d and %d doesn't match: %d\n", pid1, pid2, ret);
 			break;
 		case -1:
-			pr_perror("kcmp (type: %d, pid1: %d, pid2: %d, "
+			pr_err("kcmp (type: %d, pid1: %d, pid2: %d, "
 					"idx1: %ld, idx2: %ld) failed: %d\n",
 					type, pid1, pid2, idx1, idx2, errno);
 			break;
 		default:
-			pr_perror("kcmp (type: %d, pid1: %d, pid2: %d, "
-					"idx1: %ld, idx2: %ld) returned %d\n\n",
+			pr_err("kcmp (type: %d, pid1: %d, pid2: %d, "
+					"idx1: %ld, idx2: %ld) returned %d\n",
 					type, pid1, pid2, idx1, idx2, ret);
 			break;
 	}
diff --git a/test/zdtm/static/mntns_shared_vs_private.c b/test/zdtm/static/mntns_shared_vs_private.c
index 204ac11..5664835 100644
--- a/test/zdtm/static/mntns_shared_vs_private.c
+++ b/test/zdtm/static/mntns_shared_vs_private.c
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
 		}
 
 		if (status) {
-			pr_perror("%d/%d/%d/%d", WIFEXITED(status), WEXITSTATUS(status), WIFSIGNALED(status), WTERMSIG(status));
+			pr_err("%d/%d/%d/%d\n", WIFEXITED(status), WEXITSTATUS(status), WIFSIGNALED(status), WTERMSIG(status));
 			return 1;
 		}
 	}
diff --git a/test/zdtm/static/seccomp_filter_inheritance.c b/test/zdtm/static/seccomp_filter_inheritance.c
index 0f66916..36d183c 100644
--- a/test/zdtm/static/seccomp_filter_inheritance.c
+++ b/test/zdtm/static/seccomp_filter_inheritance.c
@@ -134,7 +134,7 @@ int main(int argc, char ** argv)
 		}
 
 		if (WTERMSIG(status) != SIGSYS) {
-			pr_perror("expected SIGSYS, got %d\n", WTERMSIG(status));
+			pr_err("expected SIGSYS, got %d\n", WTERMSIG(status));
 			_exit(1);
 		}
 
diff --git a/test/zdtm/static/seccomp_filter_tsync.c b/test/zdtm/static/seccomp_filter_tsync.c
index c7e4cc4..8b85947 100644
--- a/test/zdtm/static/seccomp_filter_tsync.c
+++ b/test/zdtm/static/seccomp_filter_tsync.c
@@ -190,7 +190,7 @@ int main(int argc, char ** argv)
 	}
 
 	if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
-		pr_perror("expected 0 exit, got %d\n", WEXITSTATUS(status));
+		pr_err("expected 0 exit, got %d\n", WEXITSTATUS(status));
 		exit(1);
 	}
 
diff --git a/test/zdtm/transition/shmem.c b/test/zdtm/transition/shmem.c
index f6b093c..5cca274 100644
--- a/test/zdtm/transition/shmem.c
+++ b/test/zdtm/transition/shmem.c
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
 	status = -1;
 	waitpid(pid, &status, 0);
 	if (status) {
-		pr_perror("The child return non-zero code: %d\n", status);
+		pr_err("The child return non-zero code: %d\n", status);
 		return 1;
 	}
 
-- 
2.7.4



More information about the CRIU mailing list