[Mplayer-cvslog] CVS: main/libmenu menu_console.c,1.9,1.10

Sascha Sommer CVS syncmail at mplayerhq.hu
Sun Sep 19 20:45:13 CEST 2004


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/libmenu
In directory mail:/var2/tmp/cvs-serv28144/libmenu

Modified Files:
	menu_console.c 
Log Message:
handle sigchld in mplayer.c

Index: menu_console.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu_console.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- menu_console.c	20 Jul 2004 17:58:33 -0000	1.9
+++ menu_console.c	19 Sep 2004 18:45:11 -0000	1.10
@@ -245,15 +245,16 @@
   r = select(max_fd+1,&rfd, NULL, NULL, &tv);
   if(r == 0) {
     r = waitpid(mpriv->child,&child_status,WNOHANG);
-    if(r > 0) {
-      printf("child died\n");
-    for(i = 0 ; i < 3 ; i++) 
-      close(mpriv->child_fd[i]);
-    mpriv->child = 0;
-    mpriv->prompt = mpriv->mp_prompt;
-    //add_line(mpriv,"Child process exited");
-    } else if(r < 0)
-      printf("waitpid error: %s\n",strerror(errno));
+    if(r < 0){
+      if(errno==ECHILD){  ///exiting childs get handled in mplayer.c
+        for(i = 0 ; i < 3 ; i++) 
+          close(mpriv->child_fd[i]);
+        mpriv->child = 0;
+        mpriv->prompt = mpriv->mp_prompt;
+        //add_line(mpriv,"Child process exited");    
+      }
+      else printf("waitpid error: %s\n",strerror(errno));
+    }
   } else if(r < 0) {
     printf("select error\n");
     return;




More information about the MPlayer-cvslog mailing list