aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2009-10-07 16:06:08 +0200
committerDaniel Lezcano <dlezcano@fr.ibm.com>2009-10-07 16:06:08 +0200
commit5379ce7836677149c0b614fcd0be0cbe16ad1709 (patch)
tree6fbfd59bf518665a2004cde41c3bc5330363d5cd
parentremove dead stop code (diff)
downloadlxc-5379ce7836677149c0b614fcd0be0cbe16ad1709.tar.gz
lxc-5379ce7836677149c0b614fcd0be0cbe16ad1709.tar.bz2
lxc-5379ce7836677149c0b614fcd0be0cbe16ad1709.zip
do some cleanup around the old init pid file
This file is no longer used, let's remove it. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rw-r--r--src/lxc/start.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/lxc/start.c b/src/lxc/start.c
index 3c70511..580b460 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -178,40 +178,6 @@ out_sigfd:
goto out;
}
-static int save_init_pid(const char *name, pid_t pid)
-{
- char init[MAXPATHLEN];
- char *val;
- int fd, err = -1;
-
- snprintf(init, MAXPATHLEN, LXCPATH "/%s/init", name);
-
- if (!asprintf(&val, "%d\n", pid)) {
- SYSERROR("failed to allocate memory");
- goto out;
- }
-
- fd = open(init, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);
- if (fd < 0) {
- SYSERROR("failed to open '%s'", init);
- goto out_free;
- }
-
- if (write(fd, val, strlen(val)) < 0) {
- SYSERROR("failed to write the init pid");
- goto out_close;
- }
-
- err = 0;
-
-out_close:
- close(fd);
-out_free:
- free(val);
-out:
- return err;
-}
-
static void remove_init_pid(const char *name, pid_t pid)
{
char init[MAXPATHLEN];
@@ -473,11 +439,6 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[])
goto out_abort;
}
- if (save_init_pid(name, handler->pid)) {
- ERROR("failed to save the init pid info");
- goto out_abort;
- }
-
if (lxc_setstate(name, RUNNING)) {
ERROR("failed to set state to %s",
lxc_state2str(RUNNING));