[BusyBox] [PATCH] eject umount patch 2

Rob Landley rob at landley.net
Fri May 13 22:39:14 UTC 2005


On Friday 13 May 2005 03:55 pm, Tito wrote:

> > > -
> > > -       return EXIT_SUCCESS;
> > > +#ifdef CONFIG_FEATURE_CLEAN_UP
> > > +       free(command);
> > > +       return(EXIT_SUCCESS);
> > > +#else
> > > +       exit(EXIT_SUCCESS);
> > > +#endif
> >
> > what's the deal with using return versus exit ?
> > -mike
>
> I thought that exit() closes open file descriptors and frees all the memory
> allocated by the program

Exiting from the program does this, yes.  But it doesn't matter how you exit: 
return from main, segfault, etc.  The operating system does this for you.

> I'll wait for some hints from the list before posting patch n°3.

I tweaked a couple of things myself and am about to apply the result as soon 
as the build finishes ok...

Rob



More information about the busybox mailing list