diff options
author | Bryan Drewery <bryan@shatow.net> | 2014-05-16 17:42:14 +0400 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2014-05-16 17:42:14 +0400 |
commit | bd1c82efae711245561494155be40efdfdde4c47 (patch) | |
tree | 655fd2f7bab368cc3fcc61d9a19dacb1e5aa2323 /external | |
parent | f4c16f6ca699a53481b0570c55298087360beb1e (diff) |
Fix build on 9.1 which does not have F_DUPFD_CLOEXEC
Diffstat (limited to 'external')
-rw-r--r-- | external/libnv/nvpair.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/external/libnv/nvpair.c b/external/libnv/nvpair.c index 916444f7..71117b84 100644 --- a/external/libnv/nvpair.c +++ b/external/libnv/nvpair.c @@ -1032,9 +1032,18 @@ nvpair_createv_descriptor(int value, const char *namefmt, va_list nameap) return (NULL); } - value = fcntl(value, F_DUPFD_CLOEXEC, 0); - if (value < 0) - return (NULL); +#ifdef F_DUPFD_CLOEXEC + value = fcntl(value, F_DUPFD_CLOEXEC, 0); + if (value < 0) + return (NULL); +#else + value = fcntl(value, F_DUPFD, 0); + if (value < 0) + return (NULL); + value = fcntl(value, F_SETFD, FD_CLOEXEC); + if (value < 0) + return (NULL); +#endif nvp = nvpair_allocv(NV_TYPE_DESCRIPTOR, (uint64_t)value, sizeof(int64_t), namefmt, nameap); |