[libdvbpsi-devel] examples/dvbinfo/tcp.c: handle setsockopt error (CID 17232)

Jean-Paul Saman git at videolan.org
Wed Apr 16 15:53:34 CEST 2014


libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri Apr 11 17:05:24 2014 +0200| [638d76dca0693894e10fb7f72cd067b76d1ab919] | committer: Jean-Paul Saman

examples/dvbinfo/tcp.c: handle setsockopt error (CID 17232)

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=638d76dca0693894e10fb7f72cd067b76d1ab919
---

 examples/dvbinfo/tcp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/dvbinfo/tcp.c b/examples/dvbinfo/tcp.c
index 280439f..3a2726e 100644
--- a/examples/dvbinfo/tcp.c
+++ b/examples/dvbinfo/tcp.c
@@ -141,7 +141,8 @@ int tcp_open(const char *ipaddress, int port)
         }
 #endif
 
-        setsockopt (s_ctl, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof (int));
+        if (setsockopt (s_ctl, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof (int)) < 0)
+            perror("tcp setsockopt error");
 
         result = connect( s_ctl, ptr->ai_addr, ptr->ai_addrlen );
         if (result < 0)



More information about the libdvbpsi-devel mailing list