Fix bookkeeper type - use key_t
This commit is contained in:
parent
11f9159138
commit
214091e490
@ -1,3 +1,6 @@
|
|||||||
|
2018-06-24
|
||||||
|
- Fix bookkeeper type - use key_t
|
||||||
|
|
||||||
2018-05-06
|
2018-05-06
|
||||||
- New bookkeeper hash broke NfSen. Fixed. ported back to release 1.6.17
|
- New bookkeeper hash broke NfSen. Fixed. ported back to release 1.6.17
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ static bookkeeper_list_t *bookkeeper_list = NULL;
|
|||||||
|
|
||||||
/* function prototypes */
|
/* 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);
|
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 */
|
/* hash: compute hash value of string */
|
||||||
#define MULTIPLIER 37
|
#define MULTIPLIER 37
|
||||||
static uint32_t hash(char *str, int flag) {
|
static key_t hash(char *str, int flag) {
|
||||||
uint32_t h;
|
uint32_t h;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
char cleanPath[MAXPATHLEN];
|
char cleanPath[MAXPATHLEN];
|
||||||
|
|
||||||
if ( realpath(str, cleanPath) == NULL ) {
|
if ( realpath(str, cleanPath) == NULL ) {
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = 0;
|
h = 0;
|
||||||
@ -97,7 +97,8 @@ char cleanPath[MAXPATHLEN];
|
|||||||
if ( flag ) {
|
if ( flag ) {
|
||||||
h = MULTIPLIER * h + 'R';
|
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
|
} // End of hash
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user