diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-10-23 08:55:40 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-10-23 08:55:40 +0000 |
| commit | e8b7285da685866a373b1112115e6dc543991ca9 (patch) | |
| tree | c0454aaafe66ae4be18effca5d95d5c0d594e0ba /plugins/dfsound | |
| parent | b2d8e7917684eb1cca4244d628e6769ba833144c (diff) | |
| download | pcsxr-e8b7285da685866a373b1112115e6dc543991ca9.tar.gz | |
Do not leave zombie process when running configure utilities.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@80664 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfsound')
| -rw-r--r-- | plugins/dfsound/cfg.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/plugins/dfsound/cfg.c b/plugins/dfsound/cfg.c index a98a695f..773ddaa2 100644 --- a/plugins/dfsound/cfg.c +++ b/plugins/dfsound/cfg.c @@ -40,42 +40,20 @@ void StartCfgTool(char * pCmdLine) cf=fopen(filename,"rb");
if(cf!=NULL)
{
+ int pid;
fclose(cf);
- if(fork()==0)
+ pid=fork();
+ if(pid==0)
{
- execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
- exit(0);
- }
- }
- else
- {
- strcpy(filename,"cfg/cfgDFSound");
- cf=fopen(filename,"rb");
- if(cf!=NULL)
- {
- fclose(cf);
if(fork()==0)
{
- chdir("cfg");
execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
- exit(0);
}
+ exit(0);
}
- else
+ else if(pid>0)
{
- sprintf(filename,"%s/cfgDFSound",getenv("HOME"));
- cf=fopen(filename,"rb");
- if(cf!=NULL)
- {
- fclose(cf);
- if(fork()==0)
- {
- chdir(getenv("HOME"));
- execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
- exit(0);
- }
- }
- else printf("Sound error: cfgDFSound not found!\n");
+ waitpid(pid,NULL,0);
}
}
}
|
