Redis 3.0.1 on Solaris 10 - flock()

55 views
Skip to first unread message

Steve Campbell

unread,
May 10, 2015, 8:50:27 AM5/10/15
to redi...@googlegroups.com
Hi,

I've just compiled Redis 3.0.1 on Solaris 10. Had some issues with

cluster.c:    if (flock(fd,LOCK_EX|LOCK_NB) == -1) {

as Solaris doesn't come with flock.

Could this be rewritten to use the more portable fcntl() instead?

$ diff cluster.c cluster.c.orig
45d44
<
372,374c371,372
<     struct flock fl;
<     fl.l_type = F_WRLCK;
<     if (fcntl(fd, F_SETLK, &fl) == -1) {
---
>
>     if (flock(fd,LOCK_EX|LOCK_NB) == -1) {


Thanks.

CharSyam

unread,
May 10, 2015, 8:51:29 AM5/10/15
to redi...@googlegroups.com
how about send PR?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Jan-Erik Rediger

unread,
May 10, 2015, 9:07:54 AM5/10/15
to redi...@googlegroups.com
Replacing flock by fcntl won't help in this case.
See my comment from last December:
https://github.com/antirez/redis/pull/1594#issuecomment-65160242

We need to completely remove the flock thingy on Solaris.
Reply all
Reply to author
Forward
0 new messages