speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix execlp processing


From: William Hubbs
Subject: [PATCH] fix execlp processing
Date: Fri, 18 Mar 2011 22:17:18 -0500

If this function returns, it indicates a failure, so there is no need to
test the return code.
---
 src/modules/festival.c |    4 ++--
 src/server/module.c    |   12 +++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/modules/festival.c b/src/modules/festival.c
index 6264108..0b4edca 100644
--- a/src/modules/festival.c
+++ b/src/modules/festival.c
@@ -1175,8 +1175,8 @@ int init_festival_standalone()
                close(module_p.pipe_out[0]);
 
                /* TODO: fix festival hardcoded path */
-               if (execlp("festival", "", (char *)0) == -1)
-                       exit(1);
+               execlp("festival", "", (char *)0);
+               exit(1);
 
        default:
                festival_process_pid = fr;
diff --git a/src/server/module.c b/src/server/module.c
index 9fe6a6f..bc35ae7 100644
--- a/src/server/module.c
+++ b/src/server/module.c
@@ -216,14 +216,12 @@ OutputModule *load_output_module(char *mod_name, char 
*mod_prog,
                }
 
                if (cfg == 0) {
-                       if (execlp(module->filename, module->filename, (char 
*)0) == -1) {
-                               exit(1);
-                       }
+                       execlp(module->filename, module->filename, (char *)0);
+                       exit(1);
                } else {
-                       //if (execlp("valgrind", "valgrind" 
,"--trace-children=yes", module->filename, arg1, arg2, (char *) 0) == -1){
-                       if (execlp(module->filename, module->filename, arg1, 
(char *)0) == -1) {
-                               exit(1);
-                       }
+                       // execlp("valgrind", "valgrind" 
,"--trace-children=yes", module->filename, arg1, arg2, (char *) 0);
+                       execlp(module->filename, module->filename, arg1, (char 
*)0);
+                       exit(1);
                }
                assert(0);
        }
-- 
1.7.3.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]