mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 21:51:47 +00:00
[CRT]
- Remove duplicated functions - Fix MSVC amd64 build - cleanup the cmake file a little - creadit wine for their code svn path=/trunk/; revision=53320
This commit is contained in:
parent
a5d2894b75
commit
c952a3638e
12 changed files with 163 additions and 211 deletions
|
@ -1136,41 +1136,6 @@ int CDECL _fileno(FILE* file)
|
|||
return file->_file;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _futime (MSVCRT.@)
|
||||
*/
|
||||
int CDECL _futime(int fd, struct _utimbuf *t)
|
||||
{
|
||||
HANDLE hand = fdtoh(fd);
|
||||
FILETIME at, wt;
|
||||
|
||||
if (hand == INVALID_HANDLE_VALUE)
|
||||
return -1;
|
||||
|
||||
if (!t)
|
||||
{
|
||||
time_t currTime;
|
||||
time(&currTime);
|
||||
RtlSecondsSince1970ToTime(currTime, (LARGE_INTEGER *)&at);
|
||||
wt = at;
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlSecondsSince1970ToTime(t->actime, (LARGE_INTEGER *)&at);
|
||||
if (t->actime == t->modtime)
|
||||
wt = at;
|
||||
else
|
||||
RtlSecondsSince1970ToTime(t->modtime, (LARGE_INTEGER *)&wt);
|
||||
}
|
||||
|
||||
if (!SetFileTime(hand, NULL, &at, &wt))
|
||||
{
|
||||
_dosmaperr(GetLastError());
|
||||
return -1 ;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _get_osfhandle (MSVCRT.@)
|
||||
*/
|
||||
|
@ -1750,38 +1715,6 @@ int CDECL _umask(int umask)
|
|||
return old_umask;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _utime (MSVCRT.@)
|
||||
*/
|
||||
int CDECL _utime(const char* path, struct _utimbuf *t)
|
||||
{
|
||||
int fd = _open(path, _O_WRONLY | _O_BINARY);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
int retVal = _futime(fd, t);
|
||||
_close(fd);
|
||||
return retVal;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _wutime (MSVCRT.@)
|
||||
*/
|
||||
int CDECL _wutime(const wchar_t* path, struct _utimbuf *t)
|
||||
{
|
||||
int fd = _wopen(path, _O_WRONLY | _O_BINARY);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
int retVal = _futime(fd, t);
|
||||
_close(fd);
|
||||
return retVal;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _write (MSVCRT.@)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue