[Ffmpeg-devel] [PATCH] Remove exit() in vhooks

Rich Felker dalias
Fri Mar 30 03:50:53 CEST 2007


On Fri, Mar 30, 2007 at 12:17:09AM +0200, Michael Niedermayer wrote:
> i
> 
> On Thu, Mar 29, 2007 at 11:46:07PM +0200, V?ctor Paesa wrote:
> > Hi,
> > 
> > The attached patch substitutes in vhooks the now forbidden exit() by return.
> > 
> > There is a legitimate usage of exit() in ppm.c (it ends life of a spawned
> > process) that I have substituted by _exit(), I don't know a more elegant way
> > of doing it.
> 
> #undef exit ?

For a forked child process, _exit() is the correct way to exit.
Calling exit() in this case is very bad because it could corrupt any
stdio files that were not flushed by the parent before forking.

Rich




More information about the ffmpeg-devel mailing list