[OpenSIPS-Devel] osipsconsole output to stderr

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu May 6 08:07:58 CEST 2010


Hi Brendan,

Do you think it is a good idea to hide the errors ? I guess you would 
like to know when something went wrong with the operation you are doing. 
The standard output is trashed as not important, but error 
notification/handling should be.

What was the error in your case?

Regards,
Bogdan

Brendan Sterne wrote:
> Greetings,
>
> osipsconsole is printing to stderr when the 'which' command fails.   
> Although 'which' is being redirected to /dev/null, stderr is not being  
> redirected.
>
> The fix I have made, is to also redirect stderr.   Attached is a diff,  
> showing the fixes.  How do I go about getting this fix committed (I am  
> new here)?
>
> < system("which db_dump > /dev/null");
> ---
>  > system("which db_dump > /dev/null 2>&1");
> 594c596
> < system("which db4.4_dump > /dev/null");
> ---
>  > system("which db4.4_dump > /dev/null 2>&1");
> 599c601
> < system("which db4.5_dump > /dev/null");
> ---
>  > system("which db4.5_dump > /dev/null 2>&1");
> 604c606
> < system("which db4.6_dump > /dev/null");
> ---
>  > system("which db4.6_dump > /dev/null 2>&1");
> 612c614
> < system("which db_load > /dev/null");
> ---
>  > system("which db_load > /dev/null 2>&1");
> 617c619
> < system("which db4.4_load > /dev/null");
> ---
>  > system("which db4.4_load > /dev/null 2>&1");
> 622c624
> < system("which db4.5_load > /dev/null");
> ---
>  > system("which db4.5_load > /dev/null 2>&1");
> 627c629
> < system("which db4.6_load > /dev/null");
> ---
>  > system("which db4.6_load > /dev/null 2>&1");
> 890c892
> <                         $TOOLPATH = `which @_`;
> ---
>  >                         $TOOLPATH = `which @_ 2> /dev/null`;
> 6841c6843
> < 			system("echo $X | $EGREP \"ERROR 1146\" > /dev/null");
> ---
>  > 			system("echo $X | $EGREP \"ERROR 1146\" > /dev/null 2>&1");
> 6855c6857
> < 			system("echo $X | $EGREP \"ERROR 1146\" > /dev/null");
> ---
>  > 			system("echo $X | $EGREP \"ERROR 1146\" > /dev/null 2>&1");
>
>
> Cheers,
> - Brendan
>
> Brendan Sterne
>
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Devel mailing list