From: Cedric Le Goater Date: Tue, 17 Nov 2009 09:56:23 +0000 (+0100) Subject: cleanup X-Git-Tag: lxc_0_6_4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00b3c2e2845792face31017e905f9b8b4ea48653;p=thirdparty%2Flxc.git cleanup should only include what is needed. This patch removes all useless headers from lxc.h and fixed other .c files. Signed-off-by: Cedric Le Goater Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 17abb1654..3fff51ebe 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -39,8 +39,9 @@ #include "error.h" #include "config.h" -#include #include +#include +#include lxc_log_define(lxc_cgroup, lxc); diff --git a/src/lxc/checkpoint.c b/src/lxc/checkpoint.c index b7f172dec..7c35331a9 100644 --- a/src/lxc/checkpoint.c +++ b/src/lxc/checkpoint.c @@ -36,11 +36,8 @@ #include #include -#include "error.h" -#include "lxc_plugin.h" -#include - #include +#include "lxc_plugin.h" lxc_log_define(lxc_checkpoint, lxc); diff --git a/src/lxc/commands.c b/src/lxc/commands.c index e0ca34872..02239e541 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -30,7 +30,9 @@ #include #include -#include +#include +#include +#include /* for struct lxc_handler */ #include "commands.h" #include "mainloop.h" diff --git a/src/lxc/conf.c b/src/lxc/conf.c index ab324ab5c..b4e3a3e49 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -50,8 +50,9 @@ #include "parse.h" #include "config.h" -#include +#include #include +#include /* for lxc_cgroup_set() */ lxc_log_define(lxc_conf, lxc); diff --git a/src/lxc/conf.h b/src/lxc/conf.h index 8a3ebf092..215f1e510 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -26,6 +26,8 @@ #include #include +#include + enum { EMPTY, VETH, diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 5e0081cb8..43bede4d7 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -34,8 +34,8 @@ #include "parse.h" -#include #include +#include lxc_log_define(lxc_confile, lxc); diff --git a/src/lxc/confile.h b/src/lxc/confile.h index d0e7653e8..20c9b3960 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -21,6 +21,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +struct lxc_conf; + extern int lxc_config_read(const char *file, struct lxc_conf *conf); diff --git a/src/lxc/console.c b/src/lxc/console.c index bd117a5e9..52f6cecf1 100644 --- a/src/lxc/console.c +++ b/src/lxc/console.c @@ -27,7 +27,10 @@ #include #include -#include +#include +#include +#include /* for struct lxc_handler */ + #include "commands.h" #include "af_unix.h" diff --git a/src/lxc/freezer.c b/src/lxc/freezer.c index f4b401877..cff954ec9 100644 --- a/src/lxc/freezer.c +++ b/src/lxc/freezer.c @@ -32,8 +32,9 @@ #include #include "error.h" -#include + #include +#include lxc_log_define(lxc_freezer, lxc); diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index 1d04b9f2e..a78fb65d7 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -33,16 +33,10 @@ extern "C" { lxc/lxc.h will contain exports of liblxc **/ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +struct lxc_msg; /* * Start the specified command inside a container diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index ae1c96488..f394d26fe 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -27,6 +27,8 @@ #include #include +#include + #include "arguments.h" lxc_log_define(lxc_cgroup, lxc); diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c index 4d0e210b6..ff59048e6 100644 --- a/src/lxc/lxc_checkpoint.c +++ b/src/lxc/lxc_checkpoint.c @@ -27,7 +27,10 @@ #include #include -#include +#include +#include +#include + #include "arguments.h" #include "config.h" diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c index b66257251..cff208f6b 100644 --- a/src/lxc/lxc_console.c +++ b/src/lxc/lxc_console.c @@ -37,8 +37,10 @@ #include #include -#include "error.h" -#include "lxc.h" +#include +#include +#include + #include "arguments.h" lxc_log_define(lxc_console, lxc); diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c index 746cb4e8b..58213503f 100644 --- a/src/lxc/lxc_execute.c +++ b/src/lxc/lxc_execute.c @@ -31,8 +31,10 @@ #include #include +#include +#include #include -#include "confile.h" + #include "arguments.h" #include "config.h" diff --git a/src/lxc/lxc_freeze.c b/src/lxc/lxc_freeze.c index a5be16c8d..770d923ff 100644 --- a/src/lxc/lxc_freeze.c +++ b/src/lxc/lxc_freeze.c @@ -27,6 +27,8 @@ #include #include +#include + #include "arguments.h" static const struct option my_longopts[] = { diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c index 34518d93e..4facbf29e 100644 --- a/src/lxc/lxc_info.c +++ b/src/lxc/lxc_info.c @@ -26,6 +26,8 @@ #include #include +#include + #include "arguments.h" static const struct option my_longopts[] = { diff --git a/src/lxc/lxc_init.c b/src/lxc/lxc_init.c index deef34310..191f7c4da 100644 --- a/src/lxc/lxc_init.c +++ b/src/lxc/lxc_init.c @@ -33,7 +33,11 @@ #include #define _GNU_SOURCE #include -#include "lxc.h" + +#include +#include +#include +#include lxc_log_define(lxc_init, lxc); diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 4befa15a9..7d141888e 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -29,6 +29,8 @@ #include #include +#include +#include #include "arguments.h" lxc_log_define(monitor, lxc); diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c index 9f4bb1dbc..77895a084 100644 --- a/src/lxc/lxc_restart.c +++ b/src/lxc/lxc_restart.c @@ -25,7 +25,9 @@ #include #include -#include +#include +#include + #include "arguments.h" static int my_checker(const struct lxc_arguments* args) diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c index ffeb66bae..de78290ff 100644 --- a/src/lxc/lxc_start.c +++ b/src/lxc/lxc_start.c @@ -39,6 +39,8 @@ #include #include +#include + #include "arguments.h" lxc_log_define(lxc_start, lxc); diff --git a/src/lxc/lxc_stop.c b/src/lxc/lxc_stop.c index 01d6d8f9a..639b7500b 100644 --- a/src/lxc/lxc_stop.c +++ b/src/lxc/lxc_stop.c @@ -26,6 +26,8 @@ #include #include +#include + #include "arguments.h" static const struct option my_longopts[] = { diff --git a/src/lxc/lxc_unfreeze.c b/src/lxc/lxc_unfreeze.c index 02ca70dda..22be8395b 100644 --- a/src/lxc/lxc_unfreeze.c +++ b/src/lxc/lxc_unfreeze.c @@ -26,6 +26,8 @@ #include #include +#include + #include "arguments.h" static const struct option my_longopts[] = { diff --git a/src/lxc/lxc_unshare.c b/src/lxc/lxc_unshare.c index f91d4cd99..463968780 100644 --- a/src/lxc/lxc_unshare.c +++ b/src/lxc/lxc_unshare.c @@ -32,7 +32,8 @@ #include #include -#include +#include +#include lxc_log_define(lxc_unshare, lxc); diff --git a/src/lxc/lxc_wait.c b/src/lxc/lxc_wait.c index bc1bb0621..a5199e212 100644 --- a/src/lxc/lxc_wait.c +++ b/src/lxc/lxc_wait.c @@ -27,6 +27,8 @@ #include #include +#include +#include #include "arguments.h" lxc_log_define(lxc_wait, lxc); diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 700f5bc3d..7ec170183 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -36,8 +36,10 @@ #include "error.h" #include "af_unix.h" -#include + #include +#include +#include lxc_log_define(lxc_monitor, lxc); diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c index 70f67266e..72e47e1ea 100644 --- a/src/lxc/namespace.c +++ b/src/lxc/namespace.c @@ -27,7 +27,7 @@ #include #include -#include +#include lxc_log_define(lxc_namespace, lxc); diff --git a/src/lxc/restart.c b/src/lxc/restart.c index f382ae38e..ce8cd802f 100644 --- a/src/lxc/restart.c +++ b/src/lxc/restart.c @@ -44,9 +44,6 @@ lxc_log_define(lxc_restart, lxc); -LXC_TTY_HANDLER(SIGINT); -LXC_TTY_HANDLER(SIGQUIT); - int lxc_restart(const char *name, int fd, unsigned long flags) { return 0; diff --git a/src/lxc/start.c b/src/lxc/start.c index 653778030..e59b4e36b 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -44,9 +44,6 @@ #include #include -#include -#include - #ifdef HAVE_SYS_SIGNALFD_H # include #else @@ -91,13 +88,19 @@ int signalfd(int fd, const sigset_t *mask, int flags) #define PR_CAPBSET_DROP 24 #endif +#include +#include +#include +#include +#include +#include +#include + #include "error.h" #include "af_unix.h" #include "mainloop.h" #include "commands.h" -#include -#include lxc_log_define(lxc_start, lxc); diff --git a/src/lxc/start.h b/src/lxc/start.h index 03d8762ee..ca0c08a56 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -20,6 +20,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef __lxc_state_h +#define __lxc_state_h + +#include +#include struct lxc_handler { @@ -40,5 +45,5 @@ 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); - +#endif diff --git a/src/lxc/state.c b/src/lxc/state.c index 6125fa36b..04966579d 100644 --- a/src/lxc/state.c +++ b/src/lxc/state.c @@ -31,8 +31,8 @@ #include #include -#include #include +#include #include "commands.h" #include "config.h" diff --git a/src/lxc/stop.c b/src/lxc/stop.c index 504d27e58..b751af51b 100644 --- a/src/lxc/stop.c +++ b/src/lxc/stop.c @@ -29,10 +29,12 @@ #include #include #include +#include #include -#include #include +#include + #include "commands.h" lxc_log_define(lxc_stop, lxc);