[Top][All Lists]

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

Directory handle not closed

From: Jason Noakes
Subject: Directory handle not closed
Date: Sat, 04 Oct 2008 14:53:29 -0400 (EDT)
User-agent: SquirrelMail/1.4.9a

I've checked out make from CVS today (10/4/08) and verified that this
problem still exists.

This Makefile shows the problem:

  FOO := $(shell mkdir -p mtmp/a)
  FOO := $(wildcard mtmp/a)
  .PHONY: clean
          rm -rf mtmp

On Linux one can easily see the directory opened but never closed with

  strace -e trace=open,close make

Part of the output is here:

  close(3)                                = 0
  close(3)                                = 0
  rm -rf mtmp

One can see that make opens up the "mtmp" directory to perform the
wildcard. However, after that the "mtmp" directory remains open while the
clean rule is executed.

On Linux systems this doesn't manifest itself as a problem, but on other
systems where a directory can not be removed as long as a file handle is
open to it, this causes the "rm -rf mtmp" to fail. This is a bug. The
directory should be closed when the wildcard is finished and before the
rule is fired.

I tried to look in the sources, but since directories are hashed and kept
around for a while, I'm not sure where to start.



<<  Jason J. Noakes  >>

reply via email to

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