[asterisk-dev] tilghman: trunk r301403 - in /trunk: ./ main/file.c

Tilghman Lesher tilghman at meg.abyt.es
Thu Jan 13 01:20:18 CST 2011


On Wed, Jan 12, 2011 at 10:41 AM, Tony Mountifield <tony at softins.co.uk> wrote:
>
> In article <E1PcoYo-0003Ef-CQ at wibble.digium.internal>,
> SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:
> >       if (f->realfilename && f->filename) {
> > -                     size = strlen(f->filename) + strlen(f->realfilename) + 15;
> > -                     cmd = alloca(size);
> > -                     memset(cmd,0,size);
> > -                     snprintf(cmd, size, "/bin/mv -f \"%s\" \"%s\"", f->filename, f->realfilename);
> > -                     ast_safe_system(cmd);
> > +             if (ast_safe_fork(0) == 0) {
> > +                     execl("/bin/mv", "mv", "-f", f->filename, f->realfilename, SENTINEL);
> > +             }
>
> Is the zombie child process reaped somewhere else?

Yes, it's reaped by default in main/asterisk.c.  The zero argument to
ast_safe_fork() indicates that I want
the default signal handler to process the exit status, instead of
handling it myself.



More information about the asterisk-dev mailing list