mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Correctly check for vm.overcommit_memory == 0 (#10841)
A regression caused by #10636 (released in 7.0.1) causes Redis startup warning about overcommit to be missing when needed and printed when not. Also, using atoi() to convert the string's value to an integer cannot discern between an actual 0 (zero) having been read, or a conversion error.
This commit is contained in:
parent
abb2ea7e3c
commit
9f3b410050
@ -150,7 +150,7 @@ int checkOvercommit(sds *error_msg) {
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if (atoi(buf)) {
|
||||
if (strtol(buf, NULL, 10) == 0) {
|
||||
*error_msg = sdsnew(
|
||||
"overcommit_memory is set to 0! Background save may fail under low memory condition. "
|
||||
"To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the "
|
||||
|
Loading…
Reference in New Issue
Block a user