History

tcp: Check the return value from getsockopt

Make sure we actually have an error code in ret, in case getsockopt failed.

Martin Storsjö committed 14 years ago

Commit bb6c1ab1 parent a840cdd1 file · +2 −1Browse files

Unified · Split

libavformat/tcp.c+2−1
@@ -139,7 +139,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags) · 138 unmodified lines
139 }139 }
140 /* test error */140 /* test error */
141 optlen = sizeof(ret);141 optlen = sizeof(ret);
142 getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);142 if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen))
143 ret = AVUNERROR(ff_neterrno());
143 if (ret != 0) {144 if (ret != 0) {
144 char errbuf[100];145 char errbuf[100];
145 ret = AVERROR(ret);146 ret = AVERROR(ret);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t