stoddard 00/02/14 16:48:42
Modified: src/lib/apr/file_io/win32 filedup.c Log: Check for DuplicateHandle() failure. Revision Changes Path 1.6 +12 -4 apache-2.0/src/lib/apr/file_io/win32/filedup.c Index: filedup.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/filedup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- filedup.c 2000/02/15 00:15:42 1.5 +++ filedup.c 2000/02/15 00:48:24 1.6 @@ -76,12 +76,20 @@ (*new_file)->cntxt = old_file->cntxt; if (have_file) { - DuplicateHandle(hCurrentProcess, (*new_file)->filehand, hCurrentProcess, - &old_file->filehand, 0, FALSE, DUPLICATE_SAME_ACCESS); + if (!DuplicateHandle(hCurrentProcess, (*new_file)->filehand, + hCurrentProcess, + &old_file->filehand, 0, FALSE, + DUPLICATE_SAME_ACCESS)) { + return GetLastError(); + } } else { - DuplicateHandle(hCurrentProcess, old_file->filehand, hCurrentProcess, - &(*new_file)->filehand, 0, FALSE, DUPLICATE_SAME_ACCESS); + if (!DuplicateHandle(hCurrentProcess, old_file->filehand, + hCurrentProcess, + &(*new_file)->filehand, 0, FALSE, + DUPLICATE_SAME_ACCESS)) { + return GetLastError(); + } } (*new_file)->fname = ap_pstrdup(old_file->cntxt, old_file->fname);