[mistelix] Fixes the socket close



commit 4031608a3f766ed24ab871b6eefcae06aac64862
Author: Jordi Mas <jmas softcatala org>
Date:   Fri Jun 26 16:35:44 2009 +0200

    Fixes the socket close

 gstreamer/mistelixsocket.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gstreamer/mistelixsocket.c b/gstreamer/mistelixsocket.c
index e0bed36..2959a51 100644
--- a/gstreamer/mistelixsocket.c
+++ b/gstreamer/mistelixsocket.c
@@ -43,7 +43,7 @@ typedef enum
 fd_set master;
 fd_set read_fds;
 int fdmax;
-int sock = 0;
+int sock = -1;
 int newfd;
 char buf [32768];
 int nbytes;
@@ -126,7 +126,7 @@ gst_mistelix_video_src_deamon_getfile (unsigned char** buffer, int* buf_length,
 	//total_count++;
 	//printf ("gst_mistelix_video_src_deamon_getfile %u\n", total_count);
 
-	if (sock == 0) {
+	if (sock == -1) {
 		gst_mistelix_video_src_deamon_init ();
 	}
 
@@ -273,8 +273,11 @@ void
 gst_mistelix_video_src_deamon_shutdown ()
 {
 	printf ("*** gst_mistelix_video_src_deamon_shutdown\n");
-	close (sock);
-	sock = 0;
+
+	if (sock != -1) {
+		close (sock);
+		sock = -1;
+	}
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]