diff options
author | not-a-robot[bot] <not-a-robot[bot]@users.noreply.github.com> | 2017-07-15 14:17:07 +0000 |
---|---|---|
committer | not-a-robot[bot] <not-a-robot[bot]@users.noreply.github.com> | 2017-07-15 14:17:07 +0000 |
commit | 74be165c8402739d329954ece50b1c4cfe9d1e16 (patch) | |
tree | 9979b871fe07403a95495d1e18dd2ad57cdd9040 /COPYING | |
parent | 7d99652241a4609409f89f6a6fb4b24944a5accf (diff) | |
parent | 706129a1619430cd0579e186767a6176089240f5 (diff) | |
parent | 6114da642991db0da3122e5d129e5050a449605a (diff) |
Merge #524 #525
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.