Author: jmorlan
Date: Wed Mar 4 10:39:44 2009
New Revision: 39862
URL:
http://svn.reactos.org/svn/reactos?rev=39862&view=rev
Log:
In the CRT, replaced __set_errno calls having Win32 error codes as their argument with
_dosmaperr.
Modified:
trunk/reactos/lib/sdk/crt/process/process.c
trunk/reactos/lib/sdk/crt/stdio/file.c
trunk/reactos/lib/sdk/crt/stdio/stat64.c
Modified: trunk/reactos/lib/sdk/crt/process/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/process/proces…
==============================================================================
--- trunk/reactos/lib/sdk/crt/process/process.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/process/process.c [iso-8859-1] Wed Mar 4 10:39:44 2009
@@ -296,7 +296,7 @@
{
dwError = GetLastError();
ERR("%x\n", dwError);
- __set_errno(dwError);
+ _dosmaperr(dwError);
return(-1);
}
CloseHandle(ProcessInformation.hThread);
Modified: trunk/reactos/lib/sdk/crt/stdio/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/file.c?r…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Wed Mar 4 10:39:44 2009
@@ -463,12 +463,12 @@
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
{
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & W_OK))
{
- __set_errno(ERROR_ACCESS_DENIED);
+ _dosmaperr(ERROR_ACCESS_DENIED);
return -1;
}
return 0;
@@ -485,12 +485,12 @@
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
{
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & W_OK))
{
- __set_errno(ERROR_ACCESS_DENIED);
+ _dosmaperr(ERROR_ACCESS_DENIED);
return -1;
}
return 0;
@@ -511,7 +511,7 @@
if (newFlags == oldFlags || SetFileAttributesA(path, newFlags))
return 0;
}
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -530,7 +530,7 @@
if (newFlags == oldFlags || SetFileAttributesW(path, newFlags))
return 0;
}
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -543,7 +543,7 @@
if(DeleteFileA(path))
return 0;
TRACE("failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -556,7 +556,7 @@
if(DeleteFileW(path))
return 0;
TRACE("failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -621,7 +621,7 @@
else if (!CloseHandle(hand))
{
WARN(":failed-last error (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
ret = -1;
}
else
@@ -655,7 +655,7 @@
return 0;
}
TRACE(":failed-last error (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
TRACE(":ok\n");
@@ -701,7 +701,7 @@
else
{
ret = -1;
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
}
}
else
@@ -827,7 +827,7 @@
return ret.QuadPart;
}
TRACE(":error-last error (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -941,7 +941,7 @@
if (pos >= 0)
{
ret = SetEndOfFile(handle);
- if (!ret) __set_errno(GetLastError());
+ if (!ret) _dosmaperr(GetLastError());
}
/* restore the file pointer */
@@ -1151,7 +1151,7 @@
if (!SetFileTime(hand, NULL, &at, &wt))
{
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1 ;
}
return 0;
@@ -1324,7 +1324,7 @@
UNLOCK_FILES();
}
else
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return ret;
}
@@ -1415,7 +1415,7 @@
if (hand == INVALID_HANDLE_VALUE) {
WARN(":failed-last error (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -1445,7 +1445,7 @@
free(patha);
return retval;
}
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
free(patha);
return -1;
}
@@ -1490,7 +1490,7 @@
return retval;
}
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -2237,7 +2237,7 @@
}
free(patha);
free(modea);
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return NULL;
}
@@ -2419,7 +2419,7 @@
{
file->_flag = 0;
WARN(":failed-last error (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
file = NULL;
}
}
@@ -2634,7 +2634,7 @@
if (DeleteFileA(path))
return 0;
TRACE(":failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -2647,7 +2647,7 @@
if (DeleteFileW(path))
return 0;
TRACE(":failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -2660,7 +2660,7 @@
if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
TRACE(":failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
@@ -2673,7 +2673,7 @@
if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
TRACE(":failed (%d)\n",GetLastError());
- __set_errno(GetLastError());
+ _dosmaperr(GetLastError());
return -1;
}
Modified: trunk/reactos/lib/sdk/crt/stdio/stat64.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/stat64.c…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/stat64.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/stat64.c [iso-8859-1] Wed Mar 4 10:39:44 2009
@@ -34,7 +34,7 @@
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &hfi))
{
TRACE("failed (%d)\n",GetLastError());
- __set_errno(ERROR_FILE_NOT_FOUND);
+ _dosmaperr(ERROR_FILE_NOT_FOUND);
return -1;
}
@@ -101,7 +101,7 @@
if (!buf)
{
WARN(":failed-NULL buf\n");
- __set_errno(ERROR_INVALID_PARAMETER);
+ _dosmaperr(ERROR_INVALID_PARAMETER);
return -1;
}
@@ -125,7 +125,7 @@
if (!GetFileInformationByHandle(hand, &hfi))
{
WARN(":failed-last error (%d)\n",GetLastError());
- __set_errno(ERROR_INVALID_PARAMETER);
+ _dosmaperr(ERROR_INVALID_PARAMETER);
return -1;
}
buf->st_mode = _S_IFREG | _S_IREAD;