On June 26, 2011, at 1:40 PM, Seblu wrote:

> On Sun, Jun 26, 2011 at 10:39 PM, Seblu <[email protected]> wrote:
>> On Sun, Jun 26, 2011 at 9:28 PM, Jacob Okamoto <[email protected]> 
>> wrote:
>>> Patch to fix FS#24879, clearing terminal text formatting after nonexistent 
>>> daemon script failure in rc.d.
>>> 
>>> Signed-off-by: Jacob Okamoto <[email protected]>
>>> ---
>>>  rc.d |    3 ++-
>>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/rc.d b/rc.d
>>> index 6d9a9f7..58dcfdc 100755
>>> --- a/rc.d
>>> +++ b/rc.d
>>> @@ -69,8 +69,9 @@ case $1 in
>>>                        if [[ -x "/etc/rc.d/$i" ]]; then
>>>                                env -i "${ENV[@]}" "/etc/rc.d/$i" "$action"
>>>                        else
>>> -                               printf "${C_OTHER}:: ${C_FAIL}Error: 
>>> ${C_DONE}Daemon script $i does not exist.\n"
>>> +                               printf "${C_OTHER}:: ${C_FAIL}Error: 
>>> ${C_DONE}Daemon script $i does not exist."
>>>                        fi
>>> +                       printf "${C_CLEAR}\n"
>>>                        (( ret += !! $? ))  # clamp exit value to 0/1
>>>                done
>> I did not tested your patch but
>> 
>> Output of
>> 
>>  env -i "${ENV[@]}" "/etc/rc.d/$i" "$action"
>> 
>> let term is a coherent state end with no need of \n !
> let term in a coherent state and with no need of \n !
>> 
>> printf "${C_OTHER}:: ${C_FAIL}Error: ${C_DONE}Daemon script $i does not 
>> exist."
>> 
>> wait a term to be cleared and need a \n
> wait term to be cleared and need a \n
>> 
>> Why do not do something like this ?
>> 
>> printf "${C_OTHER}:: ${C_FAIL}Error: ${C_DONE}Daemon script $i does
>> not exist.$'{C_CLEAR}\n"
>> 
>> --
>> Sébastien Luttringer
>> www.seblu.net
>> 
> 
> 
> 
> -- 
> Sébastien Luttringer
> www.seblu.net

Ah. Good point. I modeled that patch off of the "list" block, obviously without 
paying enough attention to the actual output. Here's attempt #2.

Signed-off-by: Jacob Okamoto <[email protected]>
---
 rc.d |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/rc.d b/rc.d
index 6d9a9f7..a7b214e 100755
--- a/rc.d
+++ b/rc.d
@@ -69,7 +69,7 @@ case $1 in
                        if [[ -x "/etc/rc.d/$i" ]]; then
                                env -i "${ENV[@]}" "/etc/rc.d/$i" "$action"
                        else
-                               printf "${C_OTHER}:: ${C_FAIL}Error: 
${C_DONE}Daemon script $i does not exist.\n"
+                               printf "${C_OTHER}:: ${C_FAIL}Error: 
${C_DONE}Daemon script $i does not exist.${C_CLEAR}\n"
                        fi
                        (( ret += !! $? ))  # clamp exit value to 0/1
                done
-- 
1.7.5.2

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to