[lxc-devel] [PATCH] [cosmetic] use same ifndef/define format for all headers

Stéphane Graber stgraber at ubuntu.com
Fri May 9 08:56:25 UTC 2014


On Thu, May 08, 2014 at 11:51:07PM -0400, S.Çağlar Onur wrote:
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/af_unix.h        | 4 ++++
>  src/lxc/arguments.h      | 4 ++--
>  src/lxc/attach.h         | 4 ++--
>  src/lxc/attach_options.h | 4 ++--
>  src/lxc/caps.h           | 4 ++--
>  src/lxc/cgroup.h         | 4 ++--
>  src/lxc/commands.h       | 4 ++--
>  src/lxc/conf.h           | 4 ++--
>  src/lxc/confile.h        | 6 +++---
>  src/lxc/console.h        | 5 +++++
>  src/lxc/error.h          | 4 ++--
>  src/lxc/genl.h           | 4 ++--
>  src/lxc/list.h           | 4 ++--
>  src/lxc/log.h            | 4 ++--
>  src/lxc/lxc.h            | 4 ++--
>  src/lxc/lxclock.h        | 4 ++--
>  src/lxc/lxcseccomp.h     | 3 ++-
>  src/lxc/lxcutmp.h        | 4 ++++
>  src/lxc/mainloop.h       | 4 ++--
>  src/lxc/monitor.h        | 4 ++--
>  src/lxc/namespace.h      | 4 ++--
>  src/lxc/network.h        | 4 ++--
>  src/lxc/nl.h             | 4 ++--
>  src/lxc/parse.h          | 4 ++--
>  src/lxc/rtnl.h           | 4 ++--
>  src/lxc/start.h          | 4 ++--
>  src/lxc/state.h          | 4 ++--
>  src/lxc/sync.h           | 4 ++--
>  src/lxc/utils.h          | 4 ++--
>  src/lxc/version.h.in     | 4 ++--
>  30 files changed, 68 insertions(+), 54 deletions(-)
> 
> diff --git a/src/lxc/af_unix.h b/src/lxc/af_unix.h
> index 81f2986..3f5d01f 100644
> --- a/src/lxc/af_unix.h
> +++ b/src/lxc/af_unix.h
> @@ -21,6 +21,9 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#ifndef __LXC_AF_UNIX_H
> +#define __LXC_AF_UNIX_H
> +
>  extern int lxc_abstract_unix_open(const char *path, int type, int flags);
>  extern int lxc_abstract_unix_close(int fd);
>  extern int lxc_abstract_unix_connect(const char *path);
> @@ -29,3 +32,4 @@ extern int lxc_abstract_unix_recv_fd(int fd, int *recvfd, void *data, size_t siz
>  extern int lxc_abstract_unix_send_credential(int fd, void *data, size_t size);
>  extern int lxc_abstract_unix_rcv_credential(int fd, void *data, size_t size);
>  
> +#endif
> diff --git a/src/lxc/arguments.h b/src/lxc/arguments.h
> index e5f0670..cc85f86 100644
> --- a/src/lxc/arguments.h
> +++ b/src/lxc/arguments.h
> @@ -21,8 +21,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __arguments_h
> -#define __arguments_h
> +#ifndef __LXC_ARGUMENTS_H
> +#define __LXC_ARGUMENTS_H
>  
>  #include <getopt.h>
>  #include <stdint.h>
> diff --git a/src/lxc/attach.h b/src/lxc/attach.h
> index 8c833b1..0fa0477 100644
> --- a/src/lxc/attach.h
> +++ b/src/lxc/attach.h
> @@ -21,8 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef _attach_h
> -#define _attach_h
> +#ifndef __LXC_ATTACH_H
> +#define __LXC_ATTACH_H
>  
>  #include <sys/types.h>
>  #include <lxc/attach_options.h>
> diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h
> index c7295fb..b035318 100644
> --- a/src/lxc/attach_options.h
> +++ b/src/lxc/attach_options.h
> @@ -22,8 +22,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef _LXC_ATTACH_OPTIONS_H
> -#define _LXC_ATTACH_OPTIONS_H
> +#ifndef __LXC_ATTACH_OPTIONS_H
> +#define __LXC_ATTACH_OPTIONS_H
>  
>  #include <sys/types.h>
>  
> diff --git a/src/lxc/caps.h b/src/lxc/caps.h
> index 1ea32ae..daa8b61 100644
> --- a/src/lxc/caps.h
> +++ b/src/lxc/caps.h
> @@ -22,8 +22,8 @@
>   */
>  #include "config.h"
>  
> -#ifndef _caps_h
> -#define _caps_h
> +#ifndef __LXC_CAPS_H
> +#define __LXC_CAPS_H
>  
>  #if HAVE_SYS_CAPABILITY_H
>  extern int lxc_caps_reset(void);
> diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h
> index 3e222a8..7e03370 100644
> --- a/src/lxc/cgroup.h
> +++ b/src/lxc/cgroup.h
> @@ -21,8 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef __lxc_cgroup_h
> -#define __lxc_cgroup_h
> +#ifndef __LXC_CGROUP_H
> +#define __LXC_CGROUP_H
>  
>  #include <stdbool.h>
>  #include <stddef.h>
> diff --git a/src/lxc/commands.h b/src/lxc/commands.h
> index 7829aef..9efe2ad 100644
> --- a/src/lxc/commands.h
> +++ b/src/lxc/commands.h
> @@ -21,8 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef __commands_h
> -#define __commands_h
> +#ifndef __LXC_COMMANDS_H
> +#define __LXC_COMMANDS_H
>  
>  #include "state.h"
>  
> diff --git a/src/lxc/conf.h b/src/lxc/conf.h
> index 865b87a..2cfcb7c 100644
> --- a/src/lxc/conf.h
> +++ b/src/lxc/conf.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _conf_h
> -#define _conf_h
> +#ifndef __LXC_CONF_H
> +#define __LXC_CONF_H
>  
>  #include "config.h"
>  
> diff --git a/src/lxc/confile.h b/src/lxc/confile.h
> index 38f04f6..171614a 100644
> --- a/src/lxc/confile.h
> +++ b/src/lxc/confile.h
> @@ -21,12 +21,12 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#ifndef __LXC_CONFILE_H
> +#define __LXC_CONFILE_H
> +
>  #include <stdio.h>
>  #include <lxc/attach_options.h>
>  
> -#ifndef _confile_h
> -#define _confile_h
> -
>  struct lxc_conf;
>  struct lxc_list;
>  
> diff --git a/src/lxc/console.h b/src/lxc/console.h
> index eb3894b..41d53e6 100644
> --- a/src/lxc/console.h
> +++ b/src/lxc/console.h
> @@ -21,6 +21,9 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#ifndef __LXC_CONSOLE_H
> +#define __LXC_CONSOLE_H
> +
>  struct lxc_epoll_descr;
>  struct lxc_container;
>  
> @@ -37,3 +40,5 @@ extern int  lxc_console(struct lxc_container *c, int ttynum,
>  extern int  lxc_console_getfd(struct lxc_container *c, int *ttynum,
>  			      int *masterfd);
>  extern int  lxc_console_set_stdfds(struct lxc_handler *);
> +
> +#endif
> diff --git a/src/lxc/error.h b/src/lxc/error.h
> index 61033d3..d5d60de 100644
> --- a/src/lxc/error.h
> +++ b/src/lxc/error.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __lxc_error_h
> -#define __lxc_error_h
> +#ifndef __LXC_ERROR_H
> +#define __LXC_ERROR_H
>  
>  extern int  lxc_error_set_and_log(int pid, int status);
>  
> diff --git a/src/lxc/genl.h b/src/lxc/genl.h
> index 20b673b..3080618 100644
> --- a/src/lxc/genl.h
> +++ b/src/lxc/genl.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __genl_h
> -#define __genl_h
> +#ifndef __LXC_GENL_H
> +#define __LXC_GENL_H
>  
>  /*
>   * Use this as a good size to allocate generic netlink messages
> diff --git a/src/lxc/list.h b/src/lxc/list.h
> index 8714fb3..0882da0 100644
> --- a/src/lxc/list.h
> +++ b/src/lxc/list.h
> @@ -21,8 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef _list_h
> -#define _list_h
> +#ifndef __LXC_LIST_H
> +#define __LXC_LIST_H
>  
>  struct lxc_list {
>  	void *elem;
> diff --git a/src/lxc/log.h b/src/lxc/log.h
> index d9f3ebc..b47f120 100644
> --- a/src/lxc/log.h
> +++ b/src/lxc/log.h
> @@ -21,8 +21,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _log_h
> -#define _log_h
> +#ifndef __LXC_LOG_H
> +#define __LXC_LOG_H
>  
>  #include "config.h"
>  
> diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h
> index 8775640..e340382 100644
> --- a/src/lxc/lxc.h
> +++ b/src/lxc/lxc.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __lxc_h
> -#define __lxc_h
> +#ifndef __LXC_LXC_H
> +#define __LXC_LXC_H
>  
>  #ifdef __cplusplus
>  extern "C" {
> diff --git a/src/lxc/lxclock.h b/src/lxc/lxclock.h
> index a02a032..e00dd8a 100644
> --- a/src/lxc/lxclock.h
> +++ b/src/lxc/lxclock.h
> @@ -20,8 +20,8 @@
>   *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
>   */
>  
> -#ifndef __LXCLOCK_H
> -#define __LXCLOCK_H
> +#ifndef __LXC_LXCLOCK_H
> +#define __LXC_LXCLOCK_H
>  
>  #include <fcntl.h>           /* For O_* constants */
>  #include <sys/stat.h>        /* For mode constants */
> diff --git a/src/lxc/lxcseccomp.h b/src/lxc/lxcseccomp.h
> index 2f64c05..bfafe3a 100644
> --- a/src/lxc/lxcseccomp.h
> +++ b/src/lxc/lxcseccomp.h
> @@ -21,7 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef _lxc_seccomp_h
> +#ifndef __LXC_LXCSECCOMP_H
> +#define __LXC_LXCSECCOMP_H
>  
>  #include "conf.h"
>  
> diff --git a/src/lxc/lxcutmp.h b/src/lxc/lxcutmp.h
> index 81848d1..062ecdf 100644
> --- a/src/lxc/lxcutmp.h
> +++ b/src/lxc/lxcutmp.h
> @@ -21,6 +21,9 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#ifndef __LXC_LXCUTMP_H
> +#define __LXC_LXCUTMP_H
> +
>  #include "config.h"
>  
>  struct lxc_handler;
> @@ -28,3 +31,4 @@ struct lxc_epoll_descr;
>  
>  int lxc_utmp_mainloop_add(struct lxc_epoll_descr *descr,
>  			  struct lxc_handler *handler);
> +#endif
> diff --git a/src/lxc/mainloop.h b/src/lxc/mainloop.h
> index 21ef577..46a820c 100644
> --- a/src/lxc/mainloop.h
> +++ b/src/lxc/mainloop.h
> @@ -21,8 +21,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef _mainloop_h
> -#define _mainloop_h
> +#ifndef __LXC_MAINLOOP_H
> +#define __LXC_MAINLOOP_H
>  
>  #include <stdint.h>
>  #include "list.h"
> diff --git a/src/lxc/monitor.h b/src/lxc/monitor.h
> index a7eb110..229696b 100644
> --- a/src/lxc/monitor.h
> +++ b/src/lxc/monitor.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __monitor_h
> -#define __monitor_h
> +#ifndef __LXC_MONITOR_H
> +#define __LXC_MONITOR_H
>  
>  #include <limits.h>
>  #include <sys/param.h>
> diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h
> index 64499cd..28f17e6 100644
> --- a/src/lxc/namespace.h
> +++ b/src/lxc/namespace.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __namespace_h
> -#define __namespace_h
> +#ifndef __LXC_NAMESPACE_H
> +#define __LXC_NAMESPACE_H
>  
>  #include <sys/syscall.h>
>  #include <sched.h>
> diff --git a/src/lxc/network.h b/src/lxc/network.h
> index 97f6b4d..079d52a 100644
> --- a/src/lxc/network.h
> +++ b/src/lxc/network.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _network_h
> -#define _network_h
> +#ifndef __LXC_NETWORK_H
> +#define __LXC_NETWORK_H
>  
>  /*
>   * Convert a string mac address to a socket structure
> diff --git a/src/lxc/nl.h b/src/lxc/nl.h
> index 621cbc6..8e737fc 100644
> --- a/src/lxc/nl.h
> +++ b/src/lxc/nl.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __nl_h
> -#define __nl_h
> +#ifndef __LXC_NL_H
> +#define __LXC_NL_H
>  
>  /*
>   * Use this as a good size to allocate generic netlink messages
> diff --git a/src/lxc/parse.h b/src/lxc/parse.h
> index ba7d639..8f75319 100644
> --- a/src/lxc/parse.h
> +++ b/src/lxc/parse.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __parse_h
> -#define __parse_h
> +#ifndef __LXC_PARSE_H
> +#define __LXC_PARSE_H
>  
>  typedef int (*lxc_dir_cb)(const char *name, const char *directory,
>  			  const char *file, void *data);
> diff --git a/src/lxc/rtnl.h b/src/lxc/rtnl.h
> index d13f2b3..d9ad45d 100644
> --- a/src/lxc/rtnl.h
> +++ b/src/lxc/rtnl.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __genl_h
> -#define __genl_h
> +#ifndef __LXC_RTNL_H
> +#define __LXC_RTNL_H
>  
>  /*
>   * Use this as a good size to allocate route netlink messages
> diff --git a/src/lxc/start.h b/src/lxc/start.h
> index e2d6bc8..ca7891c 100644
> --- a/src/lxc/start.h
> +++ b/src/lxc/start.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __lxc_state_h
> -#define __lxc_state_h
> +#ifndef __LXC_START_H
> +#define __LXC_START_H
>  
>  #include <signal.h>
>  #include <sys/param.h>
> diff --git a/src/lxc/state.h b/src/lxc/state.h
> index bad2943..4d26ce6 100644
> --- a/src/lxc/state.h
> +++ b/src/lxc/state.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _state_h
> -#define _state_h
> +#ifndef __LXC_STATE_H
> +#define __LXC_STATE_H
>  
>  typedef enum {
>  	STOPPED, STARTING, RUNNING, STOPPING,
> diff --git a/src/lxc/sync.h b/src/lxc/sync.h
> index fd129af..930fcb3 100644
> --- a/src/lxc/sync.h
> +++ b/src/lxc/sync.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef __lxc_sync_h
> -#define __lxc_sync_h
> +#ifndef __LXC_SYNC_H
> +#define __LXC_SYNC_H
>  
>  struct lxc_handler;
>  
> diff --git a/src/lxc/utils.h b/src/lxc/utils.h
> index b5e054c..f48f403 100644
> --- a/src/lxc/utils.h
> +++ b/src/lxc/utils.h
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _utils_h
> -#define _utils_h
> +#ifndef __LXC_UTILS_H
> +#define __LXC_UTILS_H
>  
>  #include <errno.h>
>  #include <stdarg.h>
> diff --git a/src/lxc/version.h.in b/src/lxc/version.h.in
> index eb9f103..803a46e 100644
> --- a/src/lxc/version.h.in
> +++ b/src/lxc/version.h.in
> @@ -20,8 +20,8 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> -#ifndef _VERSION_H
> -#define _VERSION_H
> +#ifndef __LXC_VERSION_H
> +#define __LXC_VERSION_H
>  
>  #define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@
>  #define LXC_VERSION_MINOR @LXC_VERSION_MINOR@
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140509/f66dc515/attachment.sig>


More information about the lxc-devel mailing list