Commit 929ab58a authored by Steffen Moser's avatar Steffen Moser Committed by Oran Agra
Browse files

Fixing compilation by removing flock() when compiling on Solaris (#11327)

SunOS/Solaris and its relatives don't support the flock() function.
While "redis" has been excluding setting up the lock using flock() on the cluster
configuration file when compiling under Solaris, it was still using flock() in the
unlock call while shutting down.

This pull request eliminates the flock() call also in the unlocking stage
for Oracle Solaris and its relatives.

Fix compilation regression from #10912

(cherry picked from commit 6aab4cb7)
parent 79414d45
...@@ -4223,10 +4223,13 @@ int finishShutdown(void) { ...@@ -4223,10 +4223,13 @@ int finishShutdown(void) {
/* Close the listening sockets. Apparently this allows faster restarts. */ /* Close the listening sockets. Apparently this allows faster restarts. */
closeListeningSockets(1); closeListeningSockets(1);
#if !defined(__sun)
/* Unlock the cluster config file before shutdown */ /* Unlock the cluster config file before shutdown */
if (server.cluster_enabled && server.cluster_config_file_lock_fd != -1) { if (server.cluster_enabled && server.cluster_config_file_lock_fd != -1) {
flock(server.cluster_config_file_lock_fd, LOCK_UN|LOCK_NB); flock(server.cluster_config_file_lock_fd, LOCK_UN|LOCK_NB);
} }
#endif /* __sun */
serverLog(LL_WARNING,"%s is now ready to exit, bye bye...", serverLog(LL_WARNING,"%s is now ready to exit, bye bye...",
server.sentinel_mode ? "Sentinel" : "Redis"); server.sentinel_mode ? "Sentinel" : "Redis");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment