summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2008-08-23 18:49:16 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2008-08-23 18:49:16 +0000
commit8b9af28da487aa01edb78b62a30fde0ac2540709 (patch)
tree9389ea46bd2d14cdfbf588a5b6434047c5156a32 /libavformat/tcp.c
parent47f944a2efea1af48d2f47df25ee92386dbd8491 (diff)
On failure, return directly because the fail: case does nothing. This also
allows easier control of the actual return value. Originally committed as revision 14925 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 470d0ce8d1..21a66a22b5 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -46,20 +46,21 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri);
- if (strcmp(proto,"tcp")) goto fail;
+ if (strcmp(proto,"tcp"))
+ return AVERROR(EINVAL);
if ((q = strchr(hostname,'@'))) { strcpy(tmp,q+1); strcpy(hostname,tmp); }
if (port <= 0 || port >= 65536)
- goto fail;
+ return AVERROR(EINVAL);
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(port);
if (resolve_host(&dest_addr.sin_addr, hostname) < 0)
- goto fail;
+ return AVERROR(EIO);
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0)
- goto fail;
+ return AVERROR(EIO);
ff_socket_nonblock(fd, 1);
redo: