summaryrefslogtreecommitdiff
path: root/plugins/dfxvideo
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-10-23 08:55:40 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-10-23 08:55:40 +0000
commite8b7285da685866a373b1112115e6dc543991ca9 (patch)
treec0454aaafe66ae4be18effca5d95d5c0d594e0ba /plugins/dfxvideo
parentb2d8e7917684eb1cca4244d628e6769ba833144c (diff)
downloadpcsxr-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/dfxvideo')
-rw-r--r--plugins/dfxvideo/cfg.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/plugins/dfxvideo/cfg.c b/plugins/dfxvideo/cfg.c
index 09d0485c..a985b1bf 100644
--- a/plugins/dfxvideo/cfg.c
+++ b/plugins/dfxvideo/cfg.c
@@ -172,27 +172,42 @@ void ExecCfg(char *arg) {
strcpy(cfg, "./cfgDFXVideo");
if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
+ int pid = fork();
+ if (pid == 0) {
+ if (fork() == 0) {
+ execl(cfg, "cfgDFXVideo", arg, NULL);
+ }
exit(0);
+ } else if (pid > 0) {
+ waitpid(pid, NULL, 0);
}
return;
}
strcpy(cfg, "./cfg/cfgDFXVideo");
if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
+ int pid = fork();
+ if (pid == 0) {
+ if (fork() == 0) {
+ execl(cfg, "cfgDFXVideo", arg, NULL);
+ }
exit(0);
+ } else if (pid > 0) {
+ waitpid(pid, NULL, 0);
}
return;
}
sprintf(cfg, "%s/.pcsxr/plugins/cfg/cfgDFXVideo", getenv("HOME"));
if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
+ int pid = fork();
+ if (pid == 0) {
+ if (fork() == 0) {
+ execl(cfg, "cfgDFXVideo", arg, NULL);
+ }
exit(0);
+ } else if (pid > 0) {
+ waitpid(pid, NULL, 0);
}
return;
}