diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 15:39:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 15:40:05 +0200 |
commit | 253976720653f02595dee5edb85a8a9730ba0ae3 (patch) | |
tree | 902dccc537e2f279eb76031647e37648321d78c1 /libavformat/network.h | |
parent | 8d06ce79411fc99d200ddc559bf1dd1f1434a13c (diff) | |
parent | bb9378251a167ef0116f263912e57f715c1e02ac (diff) | |
download | ffmpeg-253976720653f02595dee5edb85a8a9730ba0ae3.tar.gz |
Merge commit 'bb9378251a167ef0116f263912e57f715c1e02ac'
* commit 'bb9378251a167ef0116f263912e57f715c1e02ac':
network: Use SOCK_CLOEXEC when available
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/network.h')
-rw-r--r-- | libavformat/network.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index 9cfad114f2..6552f83fc9 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -259,4 +259,13 @@ int ff_listen_connect(int fd, const struct sockaddr *addr, int ff_http_match_no_proxy(const char *no_proxy, const char *hostname); +#ifndef SOCK_CLOEXEC +#define SOCK_CLOEXEC 0 +#endif + +static inline int ff_socket(int domain, int type, int protocol) +{ + return socket(domain, type | SOCK_CLOEXEC, protocol); +} + #endif /* AVFORMAT_NETWORK_H */ |