speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Correctly use execlp to specify module image name.


From: Boris Dušek
Subject: [PATCH] Correctly use execlp to specify module image name.
Date: Sat, 19 Mar 2011 00:32:02 +0100

On Mar 18, 2011, at 11:12 PM, Trevor Saunders wrote:

> yes, this should make debugging modules a bit more convienent, thanks
> for getting around to writing this patch :) I'd been meaning to for a
> while but never got to it :(

Debian bug #579283 got me to write it :-)

>>              if (cfg == 0) {
> 
> My cache is pretty cold here, but could you just arrange for arg1 to
> point to "" until a real file name is set to get rid of this if?

that would be of course desirable, but I am not entirely convinced yet it would
be 100% correct, and one has to be careful when messing with varargs

>> -                    if (execlp(module->filename, "", (char *)0) == -1) {
>> +                    if (execlp(module->filename, module->filename, (char 
>> *)0) == -1) {
> 
> if isn't needed, there is no such thing as a successful return from
> exec, if we get back here its an error.

there is however an unsuccessful return from exec, as you noted, so in such
case the error should be detected and acted upon (here by exit'ing)

>> -                    //if (execlp("valgrind", "" ,"--trace-children=yes", 
>> module->filename, arg1, arg2, (char *) 0) == -1){
> 
> I have no idea why that cruft is there, but as far as I can see there is
> no reason for it and it should just go away while your touching this.

I did not want to touch it since it might be useful for debugging with valgrind
(it probably was).

> same, no need for the if

same as above, there is need for if :-)


reply via email to

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