Commit 9d9ac53c authored by Pavel Emelyanov's avatar Pavel Emelyanov

rst: Don't use write_img_buf for setting last_pid sysctl

The write_img_buf will be used only for images writing, while
in this place we just have a raw file descriptor.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 03482f69
...@@ -1050,6 +1050,7 @@ static inline int fork_with_pid(struct pstree_item *item) ...@@ -1050,6 +1050,7 @@ static inline int fork_with_pid(struct pstree_item *item)
if (!(ca.clone_flags & CLONE_NEWPID)) { if (!(ca.clone_flags & CLONE_NEWPID)) {
char buf[32]; char buf[32];
int len;
ca.fd = open_proc_rw(PROC_GEN, LAST_PID_PATH); ca.fd = open_proc_rw(PROC_GEN, LAST_PID_PATH);
if (ca.fd < 0) { if (ca.fd < 0) {
...@@ -1063,8 +1064,8 @@ static inline int fork_with_pid(struct pstree_item *item) ...@@ -1063,8 +1064,8 @@ static inline int fork_with_pid(struct pstree_item *item)
goto err; goto err;
} }
snprintf(buf, sizeof(buf), "%d", pid - 1); len = snprintf(buf, sizeof(buf), "%d", pid - 1);
if (write_img_buf(ca.fd, buf, strlen(buf))) if (write(ca.fd, buf, len) != len)
goto err_unlock; goto err_unlock;
} else { } else {
ca.fd = -1; ca.fd = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment