• not-a-robot[bot]'s avatar
    Merge #524 #525 · 74be165c
    not-a-robot[bot] authored
    524: Don't pass a negative value to __redisAsyncCommand if redisFormatSdsCommandArgv fails r=badboy
    
    
    
    525: Fix compilation on FreeBSD 10.3 with default compiler r=badboy
    
    Given FreeBSD 10.3 with default compiler:
    
    > $ cc -v
    > FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
    > Target: x86_64-unknown-freebsd10.3
    
    Defining _XOPEN_SOURCE to 600 on the fixed line leads to the following errors:
    
    > cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
    > net.c:435:29: error: use of undeclared identifier 'AF_LOCAL'
    >     if (redisCreateSocket(c,AF_LOCAL) < 0)
    >                             ^
    > net.c:460:21: error: use of undeclared identifier 'AF_LOCAL'
    >     sa.sun_family = AF_LOCAL;
    >                     ^
    > 2 errors generated.
    > 
    
    AF_LOCAL is defined in sys/socket.h within ifdef __BSD_VISIBLE.
    
    __BSD_VISIBLE could be defined in sys/cdefs.h, but it is never done if _XOPEN_SOURCE is defined.
    
    So on FreeBSD _XOPEN_SOURCE shouldn't be defined.
    74be165c
async.c 22.7 KB