This is the previously controversial 1/3 patch, split into two parts.
The first patch contains these changes from last time:
- set errno = 0 before readdir, and check for errors after
- check for other errors from the chdir call which weren't ENOTDIR
- the documentation is clarified about when you might use this function
- more comprehensive tests, including the corner cases Matt mentioned.
The second patch changes the chdir(2) implementation to use openat/
fdopendir. I'm not convinced that this is a good thing since the
chdir implementation is much clearer to understand, and the chance of
the daemon ever becoming multithreaded is next to nil.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://et.redhat.com/~rjones/libguestfs/
See what it can do:
http://et.redhat.com/~rjones/libguestfs/recipes.html