Eric Blake <e...@byu.net> writes:

> According to Simon Josefsson on 12/28/2009 11:51 PM:
>> This patch looks a bit cleaner, it moves the system call into the
>> function actually responsible for creating the same files.  And it also
>> fixes lstat self-tests.
>
> On the one hand, you are correct that it is nicer to put the cleanup in
> the same location as the creation.  On the other hand, it means tests like
> test-symlinkat will encounter more forks, because they end up calling
> system() on every call into the .h file(s) rather than just once at
> startup.  Again, the point of the system() call is to ease debugging.  The
> .h files already clean up after themselves, if they run successfully to
> completion.  It is only when they fail that the cleanup-on-startup is
> useful, so repeating the cleanup multiple times during a single test just
> adds up to a waste of processes and execution time.  So I'd rather do the
> code motion in the opposite direction (out of test-lstat.h and into the
> callers).  And I really want to change ALL such uses of system(), not just
> the ones you encountered.
>
> Here's what I'm pushing:

Thank you!  Makes sense to me as well.

/Simon


Reply via email to