diff options
author | Jan-Erik Rediger <janerik@fnordig.de> | 2015-06-24 12:55:00 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-07-17 11:04:24 +0200 |
commit | 9b0a47cbc83920f2b6d20e51908978df6ab2e6cd (patch) | |
tree | 0707653d9a27bdc2266ff8eb9b92e33b0b693889 | |
parent | f22a9c0f78310a4b941df81569d88f8fac89368f (diff) | |
download | redis-9b0a47cbc83920f2b6d20e51908978df6ab2e6cd.tar.gz |
Do not attempt to lock on Solaris
-rw-r--r-- | src/cluster.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |