* fhandler_disk_file.cc (fhandler_disk_file::lock): Handle
	ERROR_NOT_LOCKED returned from UnlockFileEx.
	* fhandler_disk_file.cc (fhandler_disk_file::lock): Handle
	ERROR_NOT_LOCKED returned from UnlockFileEx.
	* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
	handle.
	* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
	handle.
	* fhandler_serial.cc (raw_read): Evaluate minchars taking the
	vmin_ > ulen case into account.  Simplify evaluating the bytes to read.
	Don't use bytes in Queue value from ClearCommError call in case vtime_
	is > 0.  Reformat GetOverlappedResult call.  Simplify call to ReadFile.
	* fhandler_serial.cc (raw_read): Evaluate minchars taking the
	vmin_ > ulen case into account.  Simplify evaluating the bytes to read.
	Don't use bytes in Queue value from ClearCommError call in case vtime_
	is > 0.  Reformat GetOverlappedResult call.  Simplify call to ReadFile.
	* fhandler_disk_file.cc (fhandler_disk_file::pread): Fix comparison
	of return value of lseek.
	* fhandler_disk_file.cc (fhandler_disk_file::pread): Fix comparison
	of return value of lseek.
	* grp.cc (initgroups32): Run get_server_groups under original token.
	* grp.cc (initgroups32): Run get_server_groups under original token.
	* include/asm/byteorder.h: Fix copyright dates.

	* autoload.cc (PrivilegeCheck): Define.
	* fhandler.cc (fhandler_base::open): Always try opening with backup
	resp. restore intent.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Always try
	opening with backup intent.
	(fhandler_disk_file::readdir): Ditto when trying to retrieve file id
	explicitely.
	* security.cc (check_file_access): Replace pbuf with correctly
	PPRIVILEGE_SET typed pset.  Check explicitely for backup and/or restore
	privileges when AccessCheck fails, to circumvent AccessCheck
	shortcoming.  Add comment to explain.

	* include/asm/byteorder.h: Correct typo.

	* include/asm/byteorder.h: Don't #define n* macros if -fnoinline is
	specified.

	* environ.cc (build_env): Don't put an empty environment variable into
	the environment.  Optimize use of "len".
	* errno.cc (ERROR_MORE_DATA): Translate to EMSGSIZE rather than EAGAIN.
	* include/asm/byteorder.h: Fix copyright dates.

	* autoload.cc (PrivilegeCheck): Define.
	* fhandler.cc (fhandler_base::open): Always try opening with backup
	resp. restore intent.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Always try
	opening with backup intent.
	(fhandler_disk_file::readdir): Ditto when trying to retrieve file id
	explicitely.
	* security.cc (check_file_access): Replace pbuf with correctly
	PPRIVILEGE_SET typed pset.  Check explicitely for backup and/or restore
	privileges when AccessCheck fails, to circumvent AccessCheck
	shortcoming.  Add comment to explain.

	* include/asm/byteorder.h: Correct typo.

	* include/asm/byteorder.h: Don't #define n* macros if -fnoinline is
	specified.

	* environ.cc (build_env): Don't put an empty environment variable into
	the environment.  Optimize use of "len".
	* errno.cc (ERROR_MORE_DATA): Translate to EMSGSIZE rather than EAGAIN.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop redundant
	access check.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop redundant
	access check.
Apply the following mainline patches to cr-0x5f1 branch:

2006-10-11  Yang Tse  <yangsita@gmail.com>

	* libc/include/machine/setjmp.h: Use __extension__ keyword for gcc's
	braced-groups.

2006-10-11  Corinna Vinschen  <corinna@vinschen.de>

	* libc/reent/reeent.c (_reclaim_reent): Free _REENT_MP_RESULT.

2006-09-13  Patrick Mansfield <patmans@us.ibm.com>

	* libc/include/math.h: Remove _CONST from _LIB_VERSION, as it is
	supposed to be writable.
	* libm/common/s_lib_ver.c: Ditto.

2006-09-06  Eric Blake  <ebb9@byu.net>

	* libc/stdio/vfprintf.c (_vfprintf_r, get_arg): Add 'hh', 'j',
	't', and 'z' modifiers.

2006-08-22  Eric Blake  <ebb9@byu.net>

	* libc/posix/popen.c (popen): Don't close output end of pipe in
	child if stdout was closed on entry.
	[HAVE_FCNTL]: In parent, mark file as close-on-exec, per POSIX.

2006-08-17  Brian Ford  <Brian.Ford@FlightSafety.com>

	* libc/time/gmtime.c: Correct man page; clock is not a
	local time and no conversion occurs.
Apply the following mainline patches to cr-0x5f1 branch:

2006-10-11  Yang Tse  <yangsita@gmail.com>

	* libc/include/machine/setjmp.h: Use __extension__ keyword for gcc's
	braced-groups.

2006-10-11  Corinna Vinschen  <corinna@vinschen.de>

	* libc/reent/reeent.c (_reclaim_reent): Free _REENT_MP_RESULT.

2006-09-13  Patrick Mansfield <patmans@us.ibm.com>

	* libc/include/math.h: Remove _CONST from _LIB_VERSION, as it is
	supposed to be writable.
	* libm/common/s_lib_ver.c: Ditto.

2006-09-06  Eric Blake  <ebb9@byu.net>

	* libc/stdio/vfprintf.c (_vfprintf_r, get_arg): Add 'hh', 'j',
	't', and 'z' modifiers.

2006-08-22  Eric Blake  <ebb9@byu.net>

	* libc/posix/popen.c (popen): Don't close output end of pipe in
	child if stdout was closed on entry.
	[HAVE_FCNTL]: In parent, mark file as close-on-exec, per POSIX.

2006-08-17  Brian Ford  <Brian.Ford@FlightSafety.com>

	* libc/time/gmtime.c: Correct man page; clock is not a
	local time and no conversion occurs.
	* glob.c: Remove.
	* glob.cc: New file.  Latest glob version from FreeBSD plus Cygwin
	specific changes (__stat64/__stat32, ignore_case_with_glob,
	drop collate functions).
	(glob3): Return GLOB_ABORTED in case directory is unreadable and
	GLOB_ERR is set, as demanded by SUSv3.
	* glob.h: Import latest version from FreeBSD.
	* glob.c: Remove.
	* glob.cc: New file.  Latest glob version from FreeBSD plus Cygwin
	specific changes (__stat64/__stat32, ignore_case_with_glob,
	drop collate functions).
	(glob3): Return GLOB_ABORTED in case directory is unreadable and
	GLOB_ERR is set, as demanded by SUSv3.
	* glob.h: Import latest version from FreeBSD.
	* glob.c: Remove.
	* glob.cc: New file.  Latest glob version from FreeBSD plus Cygwin
	specific changes (__stat64/__stat32, ignore_case_with_glob,
	drop collate functions).
	(glob3): Return GLOB_ABORTED in case directory is unreadable and
	GLOB_ERR is set, as demanded by SUSv3.
	* glob.h: Import latest version from FreeBSD.
	* fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Accomodate
	buggy RestartScan behaviour of Windows 2000.
	* wincap.h: Define has_buggy_restart_scan throughout.
	* wincap.cc: Ditto.