mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-10 00:55:47 +00:00
src: Don't use ifdef/defined for config.h
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
9c3a240bef
commit
6ae86a9c17
@ -39,15 +39,15 @@ __hidden extern struct mntent *getmntent_r(FILE *stream, struct mntent *mp,
|
|||||||
char *buffer, int bufsiz);
|
char *buffer, int bufsiz);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_SETMNTENT) || IS_BIONIC
|
#if !HAVE_SETMNTENT || IS_BIONIC
|
||||||
__hidden FILE *setmntent(const char *file, const char *mode);
|
__hidden FILE *setmntent(const char *file, const char *mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_ENDMNTENT) || IS_BIONIC
|
#if !HAVE_ENDMNTENT || IS_BIONIC
|
||||||
__hidden int endmntent(FILE *stream);
|
__hidden int endmntent(FILE *stream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_HASMNTOPT) || IS_BIONIC
|
#if !HAVE_HASMNTOPT || IS_BIONIC
|
||||||
__hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt);
|
__hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_PTY_H
|
#if HAVE_PTY_H
|
||||||
#include <pty.h>
|
#include <pty.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64)
|
#if !HAVE_PRLIMIT && HAVE_PRLIMIT64
|
||||||
#include "prlimit.h"
|
#include "prlimit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -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,
|
static int set_config_seccomp_allow_nesting(const char *key, const char *value,
|
||||||
struct lxc_conf *lxc_conf, void *data)
|
struct lxc_conf *lxc_conf, void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
if (lxc_config_value_empty(value))
|
if (lxc_config_value_empty(value))
|
||||||
return clr_config_seccomp_allow_nesting(key, lxc_conf, NULL);
|
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,
|
static int set_config_seccomp_profile(const char *key, const char *value,
|
||||||
struct lxc_conf *lxc_conf, void *data)
|
struct lxc_conf *lxc_conf, void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
return set_config_path_item(&lxc_conf->seccomp.seccomp, value);
|
return set_config_path_item(&lxc_conf->seccomp.seccomp, value);
|
||||||
#else
|
#else
|
||||||
return ret_errno(ENOSYS);
|
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,
|
int inlen, struct lxc_conf *c,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
return lxc_get_conf_int(c, retv, inlen, c->seccomp.allow_nesting);
|
return lxc_get_conf_int(c, retv, inlen, c->seccomp.allow_nesting);
|
||||||
#else
|
#else
|
||||||
return ret_errno(ENOSYS);
|
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,
|
static int get_config_seccomp_profile(const char *key, char *retv, int inlen,
|
||||||
struct lxc_conf *c, void *data)
|
struct lxc_conf *c, void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
return lxc_get_conf_str(retv, inlen, c->seccomp.seccomp);
|
return lxc_get_conf_str(retv, inlen, c->seccomp.seccomp);
|
||||||
#else
|
#else
|
||||||
return ret_errno(ENOSYS);
|
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,
|
static inline int clr_config_seccomp_allow_nesting(const char *key,
|
||||||
struct lxc_conf *c, void *data)
|
struct lxc_conf *c, void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
c->seccomp.allow_nesting = 0;
|
c->seccomp.allow_nesting = 0;
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
#include <linux/seccomp.h>
|
#include <linux/seccomp.h>
|
||||||
#include <seccomp.h>
|
#include <seccomp.h>
|
||||||
#endif
|
#endif
|
||||||
@ -29,7 +29,7 @@ struct lxc_handler;
|
|||||||
#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
|
#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_DECL_SECCOMP_NOTIFY_FD
|
#if HAVE_DECL_SECCOMP_NOTIFY_FD
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "hlist.h"
|
#include "hlist.h"
|
||||||
#include "memory_utils.h"
|
#include "memory_utils.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBURING
|
#if HAVE_LIBURING
|
||||||
#include <liburing.h>
|
#include <liburing.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ struct lxc_async_descr {
|
|||||||
async_descr_t type;
|
async_descr_t type;
|
||||||
union {
|
union {
|
||||||
int epfd;
|
int epfd;
|
||||||
#ifdef HAVE_LIBURING
|
#if HAVE_LIBURING
|
||||||
struct io_uring *ring;
|
struct io_uring *ring;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -350,7 +350,7 @@ bool wait_exited(pid_t pid)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value,
|
static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value,
|
||||||
|
Loading…
Reference in New Issue
Block a user