[CRIU] [crtools-bot for Kinsbursky Stanislav ] IPC: close image
files after use
Cyrill Gorcunov
gorcunov at openvz.org
Fri Feb 17 06:24:43 EST 2012
The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 4fc8bb0a0e9721ce8d1bcbce35aa6e17c5771098
Author: Kinsbursky Stanislav <skinsbursky at openvz.org>
Date: Fri Feb 17 12:02:49 2012 +0300
IPC: close image files after use
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
ipc_ns.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ipc_ns.c b/ipc_ns.c
index 66114d4..ecc3084 100644
--- a/ipc_ns.c
+++ b/ipc_ns.c
@@ -651,7 +651,7 @@ static int prepare_ipc_sem(int pid)
return ret;
}
}
- return 0;
+ return close_safe(&fd);
}
static int prepare_ipc_msg_queue_messages(int fd, const struct ipc_msg_entry *entry)
@@ -764,7 +764,7 @@ static int prepare_ipc_msg(int pid)
return ret;
}
}
- return 0;
+ return close_safe(&fd);
}
static int prepare_ipc_shm_pages(int fd, const struct ipc_shm_entry *shm)
@@ -856,7 +856,7 @@ static int prepare_ipc_shm(int pid)
return ret;
}
}
- return 0;
+ return close_safe(&fd);
}
static int prepare_ipc_var(int pid)
@@ -877,7 +877,12 @@ static int prepare_ipc_var(int pid)
show_var_entry(&var);
- return ipc_sysctl_req(&var, CTL_WRITE);
+ ret = ipc_sysctl_req(&var, CTL_WRITE);
+ if (ret < 0) {
+ pr_err("Failed to prepare IPC namespace variables\n");
+ return -EFAULT;
+ }
+ return close_safe(&fd);
}
int prepare_ipc_ns(int pid)
More information about the CRIU
mailing list