[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS: cvs.openbsd.org: src



CVSROOT:	/cvs
Module name:	src
Changes by:	espie_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org	2006/03/08 04:22:02

Modified files:
	usr.sbin/pkg_add/OpenBSD: PackageRepository.pm 
	usr.sbin/pkg_add/OpenBSD/PackageRepository: SCP.pm 

Log message:
fix race condition in SCP for real.

We can't control a grand-child death through gzip, so stop spawning
grand-children: create two children connected by hand through a pipe,
and when we close gzip, explicitly wait for the second child to die
as well.

This avoids race conditions between sigpipe and sigusr1.

(and as usual, the resulting code is easier to follow once you get
through the pipe/fork).

Thanks theo for the comment. ;-)