LXC_TTY_HANDLER(SIGINT);
LXC_TTY_HANDLER(SIGQUIT);
-struct lxc_handler {
- int sigfd;
- int lock;
- pid_t pid;
- char tty[MAXPATHLEN];
- sigset_t oldmask;
- struct lxc_tty_info tty_info;
-};
-
static int setup_sigchld_fd(sigset_t *oldmask)
{
sigset_t mask;
goto out;
}
-static int lxc_poll(const char *name, struct lxc_handler *handler)
+int lxc_poll(const char *name, struct lxc_handler *handler)
{
int sigfd = handler->sigfd;
int pid = handler->pid;
unlink(init);
}
-static int lxc_init(const char *name, struct lxc_handler *handler)
+int lxc_init(const char *name, struct lxc_handler *handler)
{
int err = -1;
goto out;
}
-static void lxc_fini(const char *name, struct lxc_handler *handler)
+void lxc_fini(const char *name, struct lxc_handler *handler)
{
/* The STOPPING state is there for future cleanup code
* which can take awhile
LXC_TTY_DEL_HANDLER(SIGINT);
}
-static void lxc_abort(const char *name, struct lxc_handler *handler)
+void lxc_abort(const char *name, struct lxc_handler *handler)
{
lxc_setstate(name, ABORTING);
kill(handler->pid, SIGKILL);
}
-static int lxc_spawn(const char *name, struct lxc_handler *handler, char *argv[])
+int lxc_spawn(const char *name, struct lxc_handler *handler, char *argv[])
{
int sv[2];
int clone_flags;
goto out_abort;
}
- waitpid(handler.pid, &status, 0);
-
+ while (waitpid(handler.pid, &status, 0) < 0 && errno == EINTR)
+ continue;
err = 0;
out:
lxc_fini(name, &handler);
--- /dev/null
+/*
+ * lxc: linux Container library
+ *
+ * (C) Copyright IBM Corp. 2007, 2008
+ *
+ * Authors:
+ * Daniel Lezcano <dlezcano at fr.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+struct lxc_handler {
+ int sigfd;
+ int lock;
+ pid_t pid;
+ char tty[MAXPATHLEN];
+ sigset_t oldmask;
+ struct lxc_tty_info tty_info;
+};
+
+extern int lxc_init(const char *name, struct lxc_handler *handler);
+extern int lxc_spawn(const char *name, struct lxc_handler *handler,
+ char *argv[]);
+
+extern int lxc_poll(const char *name, struct lxc_handler *handler);
+extern void lxc_abort(const char *name, struct lxc_handler *handler);
+extern void lxc_fini(const char *name, struct lxc_handler *handler);
+
+
+