[CRIU] [crtools-bot for Cyrill Gorcunov ] util: Drop jerr macros

Cyrill Gorcunov gorcunov at openvz.org
Thu Feb 16 13:05:40 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit cf8b39d4aa46d6ed1846948c478cfbb0f4ec9ae9
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date:   Wed Feb 15 18:36:32 2012 +0400

    util: Drop jerr macros
    
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-dump.c      |   17 +++++++++++++----
 include/util.h |   25 -------------------------
 2 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index da00927..3766d34 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -578,8 +578,15 @@ static int get_task_regs(pid_t pid, struct core_entry *core)
 	user_regs_struct_t regs		= {-1};
 	int ret = -1;
 
-	jerr(ptrace(PTRACE_GETREGS,	pid, NULL, &regs), err);
-	jerr(ptrace(PTRACE_GETFPREGS,	pid, NULL, &fpregs), err);
+	if (ptrace(PTRACE_GETREGS, pid, NULL, &regs)) {
+		pr_err("Can't obtain GP registers for %d\n", pid);
+		goto err;
+	}
+
+	if (ptrace(PTRACE_GETFPREGS, pid, NULL, &fpregs)) {
+		pr_err("Can't obtain FPU registers for %d\n", pid);
+		goto err;
+	}
 
 	/* Did we come from a system call? */
 	if ((int)regs.orig_ax >= 0) {
@@ -1085,8 +1092,10 @@ static int dump_task_thread(pid_t pid, struct cr_fdset *cr_fdset)
 	ret = get_task_regs(pid, core);
 	if (ret)
 		goto err_free;
-	jerr(ptrace(PTRACE_GET_TID_ADDRESS, pid, NULL,
-			&core->clear_tid_address), err_free);
+	if (ptrace(PTRACE_GET_TID_ADDRESS, pid, NULL, &core->clear_tid_address)) {
+		pr_err("Can't get TID address for %d\n", pid);
+		goto err_free;
+	}
 	pr_info("OK\n");
 
 	core->tc.task_state = TASK_ALIVE;
diff --git a/include/util.h b/include/util.h
index 5fab3f4..16508e5 100644
--- a/include/util.h
+++ b/include/util.h
@@ -37,31 +37,6 @@ extern void printk(const char *format, ...)
 #define pr_panic(fmt, ...)	printk("PANIC (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
 #define pr_warning(fmt, ...)	printk("Warning (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
 
-#define pr_err_jmp(label)					\
-	do {							\
-		printk("EJMP: %s:%d\n", __FILE__, __LINE__);	\
-		goto label;					\
-	} while (0)
-
-#define jerr(code, label)					\
-	do {							\
-		if ((code))					\
-			pr_err_jmp(label);			\
-	} while (0)
-
-#define jerr_cond(code, cond, label)				\
-	do {							\
-		if ((code) cond)				\
-			pr_err_jmp(label);			\
-	} while (0)
-
-#define jerr_rc(code, rc, label)				\
-	do {							\
-		rc = (code);					\
-		if (rc)						\
-			pr_err_jmp(label);			\
-	} while (0)
-
 #ifdef CR_DEBUG
 #define pr_debug(fmt, ...)					\
 	do {							\


More information about the CRIU mailing list