bug-findutils
[Top][All Lists]
Advanced

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

Re: [bug #34976] find: Failed to save working directory in order to [...


From: Bernhard Voelker
Subject: Re: [bug #34976] find: Failed to save working directory in order to [...]: Too many open files
Date: Mon, 07 Jan 2013 19:27:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0


On 01/07/2013 05:20 PM, Aaron Burgemeister wrote:
>   <http://savannah.gnu.org/bugs/?34976>

The following fixes the issue. Unfortunately, the test-suite is not
very comprehensive, so I can't tell 100% if it is free of side effects.
Comments?

Have a nice day,
Berny

>From 3a645ef225776b77657c9da6dae382b9205d0bd0 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Mon, 7 Jan 2013 19:22:06 +0100
Subject: [PATCH] find: fix fd leak with --execdir option (bug#34976)

Prevent "Failed to save working dir[...]: Too many open files"
error by closing the directories file descriptor.

* find/exec.c (impl_pred_exec): Free the working directory if find
executes the command in the local dir, i.e. if it has been saved
by record_exec_dir().
---
 find/exec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/find/exec.c b/find/exec.c
index b83131d..27919c1 100644
--- a/find/exec.c
+++ b/find/exec.c
@@ -212,6 +212,8 @@ impl_pred_exec (const char *pathname,
        {
          result = false;
        }
+      if (local)
+        free_cwd (execp->wd_for_exec);
     }
   if (buf)
     {
-- 
1.7.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]