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

Re: Clarification about bug #463538 is needed



OoO  Pendant le repas  du samedi  19 juillet  2008, vers  19:28, "Sergei
Golovan" <sgolovan@nes.ru> disait :

> Erlang does exactly the following when detaches from a terminal:

>  if (start_detached) {
>    int status = fork();
>    if (status != 0)
>      return 0;
>    status = fork();
>    if (status != 0)
>      return 0;

>    close(0);
>    open("/dev/null", O_RDONLY);
>    close(1);
>    open("/dev/null", O_WRONLY);
>    close(2);
>    open("/dev/null", O_WRONLY);
>  }
>  {
>    execv(emu, Eargsp); /* executing the main Erlang emulator */
>  }

> Is this behavior incorrect?

This can  be replaced  by a call  to daemon()  that just does  the right
thing. For example, it misses chdir() and setsid().
-- 
BOFH excuse #372:
Forced to support NT servers; sysadmins quit.

Attachment: pgpNxDrNWlZbd.pgp
Description: PGP signature


Reply to: