On 3/26/07, Ignacio Marambio Catán <[EMAIL PROTECTED]> wrote:
On 3/26/07, Durga Deep Tirunagari <[EMAIL PROTECTED]> wrote:
> Folks,
>
> we were running LINT against our code and it spewed out the following warning:
>
> warning: avoid using system() as it invokes the shell (E_SEC_SHELL_WARN)
>
>
> Here is the code snippet:
>
>
> sprintf (start_command,"%s", "/opt/SUNWdsee/start-slapd");
> (void) system(start_command);
>
> Any suggestions on getting rid of this warning ?
>
not using system() ? :)
nacho
ok, now seriously speaking, system() is not thread safe, it does weird
things with the signal handlers, specially if you call system() in
parallel. you should replace it with the safer popen(), read both man
pages for a better explanation
nacho
_______________________________________________
opensolaris-discuss mailing list
[email protected]