summaryrefslogtreecommitdiff
path: root/src/dumm/mconsole.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-12-05 16:15:54 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-12-05 16:15:54 +0000
commitc7f1b0530b85bc7654e68992f25ed8ced5d0a80d (patch)
tree861798cd7da646014ed6919766b053099646710d /src/dumm/mconsole.c
parent8b80ab5a6950ce6515f477624794defd7531642a (diff)
downloadvyos-strongswan-c7f1b0530b85bc7654e68992f25ed8ced5d0a80d.tar.gz
vyos-strongswan-c7f1b0530b85bc7654e68992f25ed8ced5d0a80d.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.9)
Diffstat (limited to 'src/dumm/mconsole.c')
-rw-r--r--src/dumm/mconsole.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/dumm/mconsole.c b/src/dumm/mconsole.c
index c6e0c2f08..02db5ab7e 100644
--- a/src/dumm/mconsole.c
+++ b/src/dumm/mconsole.c
@@ -201,13 +201,13 @@ static bool del_iface(private_mconsole_t *this, char *guest)
static int exec(private_mconsole_t *this, void(*cb)(void*,char*,size_t),
void *data, char *cmd)
{
- return request(this, cb, data, "exec %s", cmd);
+ return request(this, cb, data, "%s", cmd);
}
/**
* Poll until guest is ready
*/
-static bool wait_bootup(private_mconsole_t *this)
+static void wait_bootup(private_mconsole_t *this)
{
/* wait for init process to appear */
while (request(this, ignore, NULL, "exec ps -p 1 > /dev/null"))
@@ -247,7 +247,7 @@ static bool wait_for_notify(private_mconsole_t *this, char *nsock)
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- strncpy(addr.sun_path, nsock, sizeof(addr));
+ strncpy(addr.sun_path, nsock, sizeof(addr.sun_path));
if (bind(this->notify, (struct sockaddr*)&addr, sizeof(addr)) < 0)
{
DBG1("binding mconsole notify socket to '%s' failed: %m", nsock);
@@ -306,7 +306,7 @@ static bool setup_console(private_mconsole_t *this)
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- snprintf(&addr.sun_path[1], sizeof(addr.sun_path), "%5d-%d",
+ snprintf(&addr.sun_path[1], sizeof(addr.sun_path)-1, "%5d-%d",
getpid(), this->console);
if (bind(this->console, (struct sockaddr*)&addr, sizeof(addr)) < 0)
{
@@ -346,11 +346,7 @@ mconsole_t *mconsole_create(char *notify, void(*idle)(void))
}
unlink(notify);
- if (!wait_bootup(this))
- {
- destroy(this);
- return NULL;
- }
+ wait_bootup(this);
return &this->public;
}