From: Stéphane Graber Date: Tue, 7 Jun 2022 20:21:10 +0000 (-0400) Subject: src: Don't use ifdef/defined for config.h X-Git-Tag: lxc-5.0.0~7^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae86a9c17abc3c6fa1cf589a55c3336f31eb4af;p=thirdparty%2Flxc.git src: Don't use ifdef/defined for config.h Signed-off-by: Stéphane Graber --- diff --git a/src/include/lxcmntent.h b/src/include/lxcmntent.h index f8954b451..93928dd72 100644 --- a/src/include/lxcmntent.h +++ b/src/include/lxcmntent.h @@ -39,15 +39,15 @@ __hidden extern struct mntent *getmntent_r(FILE *stream, struct mntent *mp, char *buffer, int bufsiz); #endif -#if !defined(HAVE_SETMNTENT) || IS_BIONIC +#if !HAVE_SETMNTENT || IS_BIONIC __hidden FILE *setmntent(const char *file, const char *mode); #endif -#if !defined(HAVE_ENDMNTENT) || IS_BIONIC +#if !HAVE_ENDMNTENT || IS_BIONIC __hidden int endmntent(FILE *stream); #endif -#if !defined(HAVE_HASMNTOPT) || IS_BIONIC +#if !HAVE_HASMNTOPT || IS_BIONIC __hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt); #endif diff --git a/src/include/openpty.c b/src/include/openpty.c index d3cb0344b..6a38849ef 100644 --- a/src/include/openpty.c +++ b/src/include/openpty.c @@ -11,7 +11,7 @@ #include #include -#ifdef HAVE_PTY_H +#if HAVE_PTY_H #include #endif diff --git a/src/lxc/conf.c b/src/lxc/conf.c index c1ce717bf..a3293a531 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -90,7 +90,7 @@ #include #endif -#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64) +#if !HAVE_PRLIMIT && HAVE_PRLIMIT64 #include "prlimit.h" #endif diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 40f34af45..f5ff9f620 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1185,7 +1185,7 @@ static int add_hook(struct lxc_conf *lxc_conf, int which, __owns char *hook) static int set_config_seccomp_allow_nesting(const char *key, const char *value, struct lxc_conf *lxc_conf, void *data) { -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP if (lxc_config_value_empty(value)) return clr_config_seccomp_allow_nesting(key, lxc_conf, NULL); @@ -1236,7 +1236,7 @@ static int set_config_seccomp_notify_proxy(const char *key, const char *value, static int set_config_seccomp_profile(const char *key, const char *value, struct lxc_conf *lxc_conf, void *data) { -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP return set_config_path_item(&lxc_conf->seccomp.seccomp, value); #else return ret_errno(ENOSYS); @@ -4389,7 +4389,7 @@ static int get_config_seccomp_allow_nesting(const char *key, char *retv, int inlen, struct lxc_conf *c, void *data) { -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP return lxc_get_conf_int(c, retv, inlen, c->seccomp.allow_nesting); #else return ret_errno(ENOSYS); @@ -4422,7 +4422,7 @@ static int get_config_seccomp_notify_proxy(const char *key, char *retv, int inle static int get_config_seccomp_profile(const char *key, char *retv, int inlen, struct lxc_conf *c, void *data) { -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP return lxc_get_conf_str(retv, inlen, c->seccomp.seccomp); #else return ret_errno(ENOSYS); @@ -5131,7 +5131,7 @@ static inline int clr_config_console_size(const char *key, struct lxc_conf *c, static inline int clr_config_seccomp_allow_nesting(const char *key, struct lxc_conf *c, void *data) { -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP c->seccomp.allow_nesting = 0; return 0; #else diff --git a/src/lxc/lxcseccomp.h b/src/lxc/lxcseccomp.h index dcfb52d23..93ff19ca0 100644 --- a/src/lxc/lxcseccomp.h +++ b/src/lxc/lxcseccomp.h @@ -7,7 +7,7 @@ #include -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP #include #include #endif @@ -29,7 +29,7 @@ struct lxc_handler; #define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3) #endif -#ifdef HAVE_SECCOMP +#if HAVE_SECCOMP #if HAVE_DECL_SECCOMP_NOTIFY_FD diff --git a/src/lxc/mainloop.h b/src/lxc/mainloop.h index 6d6d38cf8..d6995910a 100644 --- a/src/lxc/mainloop.h +++ b/src/lxc/mainloop.h @@ -11,7 +11,7 @@ #include "hlist.h" #include "memory_utils.h" -#ifdef HAVE_LIBURING +#if HAVE_LIBURING #include #endif @@ -29,7 +29,7 @@ struct lxc_async_descr { async_descr_t type; union { int epfd; -#ifdef HAVE_LIBURING +#if HAVE_LIBURING struct io_uring *ring; #endif }; diff --git a/src/lxc/utils.c b/src/lxc/utils.c index a0757c23c..ca0c4ed29 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -350,7 +350,7 @@ bool wait_exited(pid_t pid) return true; } -#ifdef HAVE_OPENSSL +#if HAVE_OPENSSL #include static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value,