History

udp: Properly check for invalid sockets

If stdin has been closed, 0 is a valid socket descriptor.

Martin Storsjö committed 14 years ago

Commit 042b2721 parent bb6c1ab1 file · +1 −1Browse files

Unified · Split

libavformat/udp.c+1−1
@@ -200,7 +200,7 @@ static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, · 199 unmodified lines
200200 goto fail;
201201 for (res = res0; res; res=res->ai_next) {
202202 udp_fd = socket(res->ai_family, SOCK_DGRAM, 0);
203− if (udp_fd > 0) break;
203+ if (udp_fd != -1) break;
204204 log_net_error(NULL, AV_LOG_ERROR, "socket");
205205 }
206206

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