From 1af9dbfdb4d2005c65ad285924055945614c79f6 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 11 Apr 2008 08:44:07 +0000 Subject: [PATCH] Properly detach children so we dont have to pthread_join() them. Fixes a resource exhaustion issue which could stall cpdup when used with -pN. --- bin/cpdup/cpdup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/cpdup/cpdup.c b/bin/cpdup/cpdup.c index a536681e0..f295183ea 100644 --- a/bin/cpdup/cpdup.c +++ b/bin/cpdup/cpdup.c @@ -45,7 +45,7 @@ * - Is able to do incremental mirroring/backups via hardlinks from * the 'previous' version (supplied with -H path). * - * $DragonFly: src/bin/cpdup/cpdup.c,v 1.21 2008/04/11 07:31:05 dillon Exp $ + * $DragonFly: src/bin/cpdup/cpdup.c,v 1.22 2008/04/11 08:44:07 dillon Exp $ */ /*- @@ -564,7 +564,10 @@ DoCopyThread(void *arg) copy_info_t cinfo = arg; char *spath = cinfo->spath; char *dpath = cinfo->dpath; + int r; + r = pthread_detach(pthread_self()); + assert(r == 0); pthread_cond_init(&cinfo->cond, NULL); pthread_mutex_lock(&MasterMutex); cinfo->r += DoCopy(cinfo); -- 2.11.4.GIT