| 2295 | } |
| 2296 | |
| 2297 | static int updateMaxclients(long long val, long long prev, const char **err) { |
| 2298 | /* Try to check if the OS is capable of supporting so many FDs. */ |
| 2299 | if (val > prev) { |
| 2300 | adjustOpenFilesLimit(); |
| 2301 | if (server.maxclients != val) { |
| 2302 | static char msg[128]; |
| 2303 | sprintf(msg, "The operating system is not able to handle the specified number of clients, try with %d", server.maxclients); |
| 2304 | *err = msg; |
| 2305 | if (server.maxclients > prev) { |
| 2306 | server.maxclients = prev; |
| 2307 | adjustOpenFilesLimit(); |
| 2308 | } |
| 2309 | return 0; |
| 2310 | } |
| 2311 | if ((unsigned int) aeGetSetSize(server.el) < |
| 2312 | server.maxclients + CONFIG_FDSET_INCR) |
| 2313 | { |
| 2314 | if (aeResizeSetSize(server.el, |
| 2315 | server.maxclients + CONFIG_FDSET_INCR) == AE_ERR) |
| 2316 | { |
| 2317 | *err = "The event loop API used by Redis is not able to handle the specified number of clients"; |
| 2318 | return 0; |
| 2319 | } |
| 2320 | } |
| 2321 | } |
| 2322 | return 1; |
| 2323 | } |
| 2324 | |
| 2325 | static int updateOOMScoreAdj(int val, int prev, const char **err) { |
| 2326 | UNUSED(prev); |
nothing calls this directly
no test coverage detected