[Patch] Avoid duplicate names in /proc/registry (which may crash find)

Christian Franke Christian.Franke@t-online.de
Thu Dec 4 20:50:00 GMT 2008


Here is a simple approach to handle the duplicate key/value name problem 
in /proc/registry. A value is skipped if key with same name exists. 
Number of actual key existence checks are reduced by a simple hash table.

The patch also adds dirent.d_type support, find does no longer crash.

Christian


2008-12-04  Christian Franke  <franke@computer.org>

	* fhandler_registry.cc (__DIR_hash): New class.
	(d_hash): New macro.
	(key_exists): New function.
	(fhandler_registry::readdir): Allocate __DIR_hash.
	Record key names in hash table. Skip value if key
	with same name exists. Fix error handling of
	encode_regname (). Set dirent.d_type.
	(fhandler_registry::closedir): Delete __DIR_hash.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin-1.7-registry-nodups.patch
Type: text/x-patch
Size: 3526 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20081204/09ca2ed4/attachment.bin>


More information about the Cygwin-patches mailing list