This is an automated email from the git hooks/post-receive script.
spichugi pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 668475a Issue 50984 - Fix disk_mon_check_diskspace types
668475a is described below
commit 668475ae474524a8023515d794db22fa8d2f540d
Author: Simon Pichugin <spichugi(a)redhat.com>
AuthorDate: Wed Jul 15 21:25:00 2020 +0200
Issue 50984 - Fix disk_mon_check_diskspace types
Description: Function parameters are inconsistence.
Documentation states that threshold should be from 0 to 2^63 - 1
so we can use uint64_t for that.
https://pagure.io/389-ds-base/issue/50984
Reviewed by: firstyear (Thanks!)
---
ldap/servers/slapd/daemon.c | 6 +++---
ldap/servers/slapd/libglobs.c | 6 +++---
ldap/servers/slapd/main.c | 2 +-
ldap/servers/slapd/proto-slap.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 772b496..0c5585e 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -345,8 +345,8 @@ disk_mon_check_diskspace(char **dirs, uint64_t threshold, uint64_t
*disk_space)
uint64_t freeBytes = 0;
uint64_t blockSize = 0;
char *worst_dir = NULL;
- int hit_threshold = 0;
- int i = 0;
+ int32_t hit_threshold = 0;
+ int32_t i = 0;
for (i = 0; dirs && dirs[i]; i++) {
if (statvfs(dirs[i], &buf) != -1) {
@@ -396,7 +396,7 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
char *dirstr = NULL;
uint64_t previous_mark = 0;
uint64_t disk_space = 0;
- int64_t threshold = 0;
+ uint64_t threshold = 0;
uint64_t halfway = 0;
time_t start = 0;
time_t now = 0;
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 97af7bb..7d5374c 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -2031,7 +2031,7 @@ config_set_disk_threshold(const char *attrname, char *value, char
*errorbuf, int
if (apply) {
CFG_LOCK_WRITE(slapdFrontendConfig);
- slapdFrontendConfig->disk_threshold = threshold;
+ slapdFrontendConfig->disk_threshold = (uint64_t)threshold;
CFG_UNLOCK_WRITE(slapdFrontendConfig);
}
@@ -5164,11 +5164,11 @@ config_get_disk_grace_period()
return retVal;
}
-PRInt64
+uint64_t
config_get_disk_threshold()
{
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
- PRInt64 retVal;
+ uint64_t retVal;
CFG_LOCK_READ(slapdFrontendConfig);
retVal = slapdFrontendConfig->disk_threshold;
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index 9e5219c..694375b 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -894,7 +894,7 @@ main(int argc, char **argv)
char **dirs = NULL;
char *dirstr = NULL;
uint64_t disk_space = 0;
- int64_t threshold = 0;
+ uint64_t threshold = 0;
uint64_t halfway = 0;
threshold = config_get_disk_threshold();
halfway = threshold / 2;
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index 41308f1..3acc24f 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -545,7 +545,7 @@ void config_set_auditfaillog_enabled(int value);
int config_get_accesslog_logging_enabled(void);
int config_get_disk_monitoring(void);
int config_get_disk_threshold_readonly(void);
-PRInt64 config_get_disk_threshold(void);
+uint64_t config_get_disk_threshold(void);
int config_get_disk_grace_period(void);
int config_get_disk_logging_critical(void);
int config_get_ndn_cache_count(void);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.