* fhandler_registry.cc: Use NAME_MAX + 1 instead of CYG_MAX_PATH

throughout for subkey name buffer size.
	* fhandler_socket.cc (search_wsa_event_slot): Use MAX_PATH instead of
	CYG_MAX_PATH for mutext name buffer size.
	(fhandler_socket::init_events): Ditto.
	* fhandler_virtual.cc (fhandler_virtual::opendir): Check path length
	against PATH_MAX instead of against CYG_MAX_PATH.
	* registry.cc (get_registry_hive_path): Use PATH_MAX instead of
	CYG_MAX_PATH for registry value path buffer size.
	* shared.cc (open_shared): Use MAX_PATH instead of CYG_MAX_PATH
	for shared memory name buffer size.
	* thread.cc (semaphore::semaphore): Use MAX_PATH instead of CYG_MAX_PATH
	for semaphore name buffer size.
	* uinfo.cc (cygheap_user::env_userprofile): Use PATH_MAX instead of
	CYG_MAX_PATH for temporary path name buffer size.
	* winf.h (LINE_BUF_CHUNK): Define as MAX_PATH * 2.
	* include/sys/dirent.h: Include sys/limits.h.  Define name buffer sizes
	using NAME_MAX.
This commit is contained in:
Corinna Vinschen
2007-12-05 15:10:20 +00:00
parent 8c7c7178c7
commit 5224a7bbf3
10 changed files with 44 additions and 22 deletions

View File

@@ -54,7 +54,7 @@ fhandler_virtual::opendir (int fd)
if (exists () <= 0)
set_errno (ENOTDIR);
else if ((len = strlen (get_name ())) > CYG_MAX_PATH - 3)
else if ((len = strlen (get_name ())) > PATH_MAX - 3)
set_errno (ENAMETOOLONG);
else if ((dir = (DIR *) malloc (sizeof (DIR))) == NULL)
set_errno (ENOMEM);