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

Tony Mountifield tony at mountifield.org
Thu Jan 13 01:59:54 CST 2011


In article <AANLkTi=BA=+Y4MRte6i4CNibeRGrjXw3FGGNnn27Ni4P at mail.gmail.com>,
Tilghman Lesher <tilghman at meg.abyt.es> wrote:
> 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.

Cool, thanks!

Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list