Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
389-ds.16015
0001-Issue-50984-Fix-disk_mon_check_diskspace-t...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Issue-50984-Fix-disk_mon_check_diskspace-types.patch of Package 389-ds.16015
From 6023396b7cdc149ce42f8a50558dccbf76a502cc Mon Sep 17 00:00:00 2001 From: Simon Pichugin <spichugi@redhat.com> Date: Wed, 15 Jul 2020 21:25:00 +0200 Subject: [PATCH] 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 | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index d75ca9eb9..81a709803 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 d9225a3d2..cc8853667 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -1981,7 +1981,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); } @@ -5107,11 +5107,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 818970b8b..8e07f2d18 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 ac0261882..7134b69d8 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -543,7 +543,7 @@ void config_set_auditlog_enabled(int value); void config_set_auditfaillog_enabled(int value); int config_get_accesslog_logging_enabled(void); int config_get_disk_monitoring(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); @@ -1499,6 +1499,7 @@ void slapd_do_nothing(int); void slapd_wait4child(int); void disk_mon_get_dirs(char ***list); int32_t disk_get_info(char *dir, uint64_t *total_space, uint64_t *avail_space, uint64_t *used_space); +char *disk_mon_check_diskspace(char **dirs, uint64_t threshold, uint64_t *disk_space); /* * main.c -- 2.24.3 (Apple Git-128)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor