more msvc compile fixes by Brezenbak and I
[reactos.git] / reactos / lib / crt / io / wutime.c
1 #include "precomp.h"
2 #include <stdio.h>
3 #include <io.h>
4 #include <errno.h>
5 #include <sys/utime.h>
6 #include <internal/file.h>
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 }
26