src: Don't use ifdef/defined for config.h

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Stéphane Graber 2022-06-07 16:21:10 -04:00
parent 9c3a240bef
commit 6ae86a9c17
No known key found for this signature in database
GPG Key ID: C638974D64792D67
7 changed files with 15 additions and 15 deletions

View 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

View File

@ -11,7 +11,7 @@
#include <termios.h>
#include <unistd.h>
#ifdef HAVE_PTY_H
#if HAVE_PTY_H
#include <pty.h>
#endif

View 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

View 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

View 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

View 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
};

View 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,