summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Moser <public@steffen-moser.de>2022-09-27 15:20:13 +0200
committerOran Agra <oran@redislabs.com>2022-12-12 17:36:34 +0200
commit929ab58a1229d333f60396af2bdfe762f7967d46 (patch)
tree40733167073fbbc3de7b396bf20cec3689f70fdf
parent79414d45fb62d6b0960c93438afd46c37e2de937 (diff)
downloadredis-929ab58a1229d333f60396af2bdfe762f7967d46.tar.gz
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 6aab4cb73662578174a14dc846fdc64e1dd71eb2)
-rw-r--r--src/server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c
index b0cef8870..7ace51087 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4223,10 +4223,13 @@ int finishShutdown(void) {
/* Close the listening sockets. Apparently this allows faster restarts. */
closeListeningSockets(1);
+#if !defined(__sun)
/* Unlock the cluster config file before shutdown */
if (server.cluster_enabled && server.cluster_config_file_lock_fd != -1) {
flock(server.cluster_config_file_lock_fd, LOCK_UN|LOCK_NB);
}
+#endif /* __sun */
+
serverLog(LL_WARNING,"%s is now ready to exit, bye bye...",
server.sentinel_mode ? "Sentinel" : "Redis");