]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
src: Don't use ifdef/defined for config.h
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 7 Jun 2022 20:21:10 +0000 (16:21 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 8 Jun 2022 04:47:05 +0000 (00:47 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/include/lxcmntent.h
src/include/openpty.c
src/lxc/conf.c
src/lxc/confile.c
src/lxc/lxcseccomp.h
src/lxc/mainloop.h
src/lxc/utils.c

index f8954b4510b958474b9a46945ebff6fe2dcdcdf0..93928dd721c1097dd89ad64b4770e94c3828a163 100644 (file)
@@ -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
 
index d3cb0344bae28f467a4f4a527987b57e68d0c00d..6a38849efc9788b1e6299ba35ccd509a19418b81 100644 (file)
@@ -11,7 +11,7 @@
 #include <termios.h>
 #include <unistd.h>
 
-#ifdef HAVE_PTY_H
+#if HAVE_PTY_H
 #include <pty.h>
 #endif
 
index c1ce717bff7e881ed5073a3ef68547b708d549e0..a3293a5315f0c6e4548edc3a05668a4f300e6912 100644 (file)
@@ -90,7 +90,7 @@
 #include <mntent.h>
 #endif
 
-#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64)
+#if !HAVE_PRLIMIT && HAVE_PRLIMIT64
 #include "prlimit.h"
 #endif
 
index 40f34af4518f7be545b25e6803dd44fffe2171a5..f5ff9f6204d2068d56d712cfc9ed7bde1fd872ad 100644 (file)
@@ -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
index dcfb52d23b025cea59ad2142740e89aef5510d94..93ff19ca0eec5440f376bca7f87c11b4c115ad1e 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <errno.h>
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <linux/seccomp.h>
 #include <seccomp.h>
 #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
index 6d6d38cf80c871c4e2511ac0ee9e61482b04101e..d6995910a92a1915e8bfaab18dc5ed70ae71827c 100644 (file)
@@ -11,7 +11,7 @@
 #include "hlist.h"
 #include "memory_utils.h"
 
-#ifdef HAVE_LIBURING
+#if HAVE_LIBURING
 #include <liburing.h>
 #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
        };
index a0757c23c7fea70ded8c23f6460c6fff741ecf92..ca0c4ed29824e9f862fc38983dc190ed726bfd62 100644 (file)
@@ -350,7 +350,7 @@ bool wait_exited(pid_t pid)
        return true;
 }
 
-#ifdef HAVE_OPENSSL
+#if HAVE_OPENSSL
 #include <openssl/evp.h>
 
 static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value,