Skip to content

Commit

Permalink
build problems at alpine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
kazimsarikaya authored and mreynolds389 committed Nov 8, 2020
1 parent 04ba05e commit a2c7e50
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ldap/servers/plugins/sync/sync_persist.c
Expand Up @@ -9,9 +9,6 @@
#include <config.h>
#endif

#include <nspr4/prlog.h>
#include <bits/stdint-intn.h>

#include "sync.h"

/* Main list of established persistent synchronizaton searches */
Expand Down
8 changes: 8 additions & 0 deletions ldap/servers/slapd/libglobs.c
Expand Up @@ -251,10 +251,12 @@ slapi_onoff_t init_cn_uses_dn_syntax_in_dns;
slapi_onoff_t init_global_backend_local;
slapi_onoff_t init_enable_nunc_stans;
#if defined(LINUX)
#if defined(__GLIBC__)
slapi_int_t init_malloc_mxfast;
slapi_int_t init_malloc_trim_threshold;
slapi_int_t init_malloc_mmap_threshold;
#endif
#endif
slapi_onoff_t init_extract_pem;
slapi_onoff_t init_ignore_vattrs;
slapi_onoff_t init_enable_upgrade_hash;
Expand Down Expand Up @@ -1133,6 +1135,7 @@ static struct config_get_and_set
(void **)&global_slapdFrontendConfig.cn_uses_dn_syntax_in_dns, CONFIG_ON_OFF,
(ConfigGetFunc)config_get_cn_uses_dn_syntax_in_dns, &init_cn_uses_dn_syntax_in_dns, NULL},
#if defined(LINUX)
#if defined(__GLIBC__)
{CONFIG_MALLOC_MXFAST, config_set_malloc_mxfast,
NULL, 0,
(void **)&global_slapdFrontendConfig.malloc_mxfast,
Expand All @@ -1148,6 +1151,7 @@ static struct config_get_and_set
(void **)&global_slapdFrontendConfig.malloc_mmap_threshold,
CONFIG_INT, (ConfigGetFunc)config_get_malloc_mmap_threshold,
&init_malloc_mmap_threshold, NULL},
#endif
#endif
{CONFIG_IGNORE_TIME_SKEW, config_set_ignore_time_skew,
NULL, 0,
Expand Down Expand Up @@ -1794,9 +1798,11 @@ FrontendConfig_init(void)
cfg->rootdn = slapi_ch_strdup(SLAPD_DEFAULT_DIRECTORY_MANAGER);
init_enable_nunc_stans = cfg->enable_nunc_stans = LDAP_OFF;
#if defined(LINUX)
#if defined(__GLIBC__)
init_malloc_mxfast = cfg->malloc_mxfast = DEFAULT_MALLOC_UNSET;
init_malloc_trim_threshold = cfg->malloc_trim_threshold = DEFAULT_MALLOC_UNSET;
init_malloc_mmap_threshold = cfg->malloc_mmap_threshold = DEFAULT_MALLOC_UNSET;
#endif
#endif
init_extract_pem = cfg->extract_pem = LDAP_ON;
/*
Expand Down Expand Up @@ -8548,6 +8554,7 @@ config_get_extract_pem()
}

#if defined(LINUX)
#if defined(__GLIBC__)
int
config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int apply __attribute__((unused)))
{
Expand Down Expand Up @@ -8675,6 +8682,7 @@ config_get_malloc_mmap_threshold()
return retVal;
}
#endif
#endif

char *
slapi_err2string(int result)
Expand Down
2 changes: 2 additions & 0 deletions ldap/servers/slapd/main.c
Expand Up @@ -529,6 +529,7 @@ main(int argc, char **argv)
daemon_ports_t ports_info = {0};

#ifdef LINUX
#if defined(__GLIBC__)
char *m = getenv("SLAPD_MXFAST");
if (m) {
int val = atoi(m);
Expand All @@ -538,6 +539,7 @@ main(int argc, char **argv)
mallopt(M_MXFAST, val);
}
}
#endif
#endif

/*
Expand Down
3 changes: 3 additions & 0 deletions ldap/servers/slapd/slapi2nspr.c
Expand Up @@ -189,11 +189,14 @@ slapi_new_rwlock_prio(int32_t prio_writer)
pthread_rwlockattr_t attr;

pthread_rwlockattr_init(&attr);

#if defined(__GLIBC__)
if (prio_writer) {
pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
} else {
pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_READER_NP);
}
#endif

rwlock = (pthread_rwlock_t *)slapi_ch_malloc(sizeof(pthread_rwlock_t));
if (rwlock) {
Expand Down

0 comments on commit a2c7e50

Please sign in to comment.