aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmenu
diff options
context:
space:
mode:
authorGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-19 18:45:11 +0000
committerGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-19 18:45:11 +0000
commita5b8e5f858e6e43c482ee5f70f19e64684d6e018 (patch)
tree3f016bc50f2c85c2f85211dc5c31f925c26d484b /libmenu
parentb63f5b3e8510511978b073128e3e5843c6b1177b (diff)
handle sigchld in mplayer.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13392 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu_console.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c
index 057c3cf763..503d25a11e 100644
--- a/libmenu/menu_console.c
+++ b/libmenu/menu_console.c
@@ -245,15 +245,16 @@ static void check_child(menu_t* menu) {
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;