update for HEAD-2003091401
[reactos.git] / lib / msvcrt / io / wutime.c
1 #include <msvcrt/stdio.h>
2 #include <msvcrt/io.h>
3 #include <msvcrt/errno.h>
4 #include <msvcrt/sys/utime.h>
5 #include <msvcrt/internal/file.h>
6
7
8 /*
9  * @implemented
10  */
11 int _wutime(const wchar_t* filename, struct _utimbuf* buf)
12 {
13     int fn;
14     int ret;
15   
16     fn = _wopen(filename, _O_RDWR);
17     if (fn == -1) {
18         __set_errno(EBADF);
19         return -1;
20     }
21     ret = _futime(fn, buf);
22     if (_close(fn) < 0)
23         return -1;
24     return ret;
25 }