From d28c51d166f554633da2fd44a26ecec2be420ee7 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 24 Jun 2015 12:55:00 +0200 Subject: Do not attempt to lock on Solaris --- src/cluster.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index fb45bd063..6280677ae 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -358,6 +358,11 @@ void clusterSaveConfigOrDie(int do_fsync) { * On success REDIS_OK is returned, otherwise an error is logged and * the function returns REDIS_ERR to signal a lock was not acquired. */ int clusterLockConfig(char *filename) { +/* flock() does not exist on Solaris + * and a fcntl-based solution won't help, as we constantly re-open that file, + * which will release _all_ locks anyway + */ +#if !defined(__sun) /* To lock it, we need to open the file in a way it is created if * it does not exist, otherwise there is a race condition with other * processes. */ @@ -385,6 +390,8 @@ int clusterLockConfig(char *filename) { } /* Lock acquired: leak the 'fd' by not closing it, so that we'll retain the * lock to the file as long as the process exists. */ +#endif /* __sun */ + return REDIS_OK; } -- cgit v1.2.1 From c7462ca9ffd8ccafee2605bd5c69e6a5bc5b240a Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 24 Jun 2015 14:48:48 +0200 Subject: Don't include sysctl header It's not needed (anymore) and is not available on Solaris. --- src/redis.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 09653119a..c2f572930 100644 --- a/src/redis.c +++ b/src/redis.c @@ -53,7 +53,6 @@ #include #include #include -#include #include /* Our shared "common" objects */ -- cgit v1.2.1