Fix bookkeeper type - use key_t

This commit is contained in:
Peter Haag 2018-06-24 11:12:31 +02:00
parent 11f9159138
commit 214091e490
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2018-06-24
- Fix bookkeeper type - use key_t
2018-05-06
- New bookkeeper hash broke NfSen. Fixed. ported back to release 1.6.17

View File

@ -69,7 +69,7 @@ static bookkeeper_list_t *bookkeeper_list = NULL;
/* function prototypes */
static uint32_t hash(char *str, int flag);
static key_t hash(char *str, int flag);
static void sem_lock(int sem_set_id);
@ -81,13 +81,13 @@ static inline bookkeeper_list_t *Get_bookkeeper_list_entry(bookkeeper_t *bookkee
/* hash: compute hash value of string */
#define MULTIPLIER 37
static uint32_t hash(char *str, int flag) {
static key_t hash(char *str, int flag) {
uint32_t h;
unsigned char *p;
char cleanPath[MAXPATHLEN];
if ( realpath(str, cleanPath) == NULL ) {
return 0;
return -1;
}
h = 0;
@ -97,7 +97,8 @@ char cleanPath[MAXPATHLEN];
if ( flag ) {
h = MULTIPLIER * h + 'R';
}
return h; // or, h % ARRAY_SIZE;
// LogError("Bookeeper hash for path: '%s' -> '%s': %u flag: %i", str, cleanPath, h, flag);
return (key_t)h; // or, h % ARRAY_SIZE;
} // End of hash