Changeset 2389
- Timestamp:
- 30/11/2008 21:54:55 (22 months ago)
- Location:
- box/trunk/lib/win32
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/win32/emu.cpp
r2287 r2389 31 31 static bool gFinishTimer; 32 32 static CRITICAL_SECTION gLock; 33 34 DWORD winerrno; 33 35 34 36 typedef struct … … 286 288 if (len == 0) 287 289 { 290 winerrno = GetLastError(); 288 291 if (logErrors) 289 292 { 290 293 ::syslog(LOG_WARNING, 291 294 "Failed to convert string to wide string: " 292 "%s", GetErrorMessage( GetLastError()).c_str());295 "%s", GetErrorMessage(winerrno).c_str()); 293 296 } 294 297 errno = EINVAL; … … 306 309 "out of memory"); 307 310 } 311 winerrno = ERROR_OUTOFMEMORY; 308 312 errno = ENOMEM; 309 313 return NULL; … … 322 326 if (len == 0) 323 327 { 328 winerrno = GetLastError(); 324 329 if (logErrors) 325 330 { 326 331 ::syslog(LOG_WARNING, 327 332 "Failed to convert string to wide string: " 328 "%s", GetErrorMessage( GetLastError()).c_str());333 "%s", GetErrorMessage(winerrno).c_str()); 329 334 } 330 335 errno = EACCES; … … 520 525 pFileName); 521 526 errno = ENAMETOOLONG; 527 winerrno = ERROR_INVALID_NAME; 522 528 tmpStr = ""; 523 529 return tmpStr; … … 595 601 HANDLE openfile(const char *pFileName, int flags, int mode) 596 602 { 603 winerrno = ERROR_INVALID_FUNCTION; 604 597 605 std::string AbsPathWithUnicode = 598 606 ConvertPathToAbsoluteUnicode(pFileName); … … 668 676 if (hdir == INVALID_HANDLE_VALUE) 669 677 { 670 switch(GetLastError()) 678 winerrno = GetLastError(); 679 switch(winerrno) 671 680 { 672 681 case ERROR_SHARING_VIOLATION: … … 685 694 } 686 695 696 winerrno = NO_ERROR; 687 697 return hdir; 688 698 } -
box/trunk/lib/win32/emu.h
r2207 r2389 246 246 #define O_LOCK 0x10000 247 247 248 extern DWORD winerrno; /* used to report errors from openfile() */ 248 249 HANDLE openfile(const char *filename, int flags, int mode); 249 250
