[mistelix/stable] Fixes the socket close
- From: Jordi Mas <jmas src gnome org>
- To: svn-commits-list gnome org
- Subject: [mistelix/stable] Fixes the socket close
- Date: Fri, 26 Jun 2009 14:49:25 +0000 (UTC)
commit 7f7bb6cce72f1be7b285b4d10915c6d7c6d780b4
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]