diff options
| author | Anatol Belski <ab@php.net> | 2014-11-10 09:14:15 +0100 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-11-10 10:58:19 +0100 |
| commit | 999d387bf8183e6ddb755dd3e6e4454044c28641 (patch) | |
| tree | 06fc80635c1bfc68ecebeef44295129ade39a3cf /Zend/zend_virtual_cwd.c | |
| parent | 249e3de5da9cc7b5dc5bde81ad8ac9e8034349d4 (diff) | |
| download | php-git-999d387bf8183e6ddb755dd3e6e4454044c28641.tar.gz | |
move these functions to the appropriate place
and include the necessary header
Diffstat (limited to 'Zend/zend_virtual_cwd.c')
| -rw-r--r-- | Zend/zend_virtual_cwd.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 385df393bf..f8b42b1596 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -1540,55 +1540,6 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */ /* }}} */ #if HAVE_UTIME -#ifdef TSRM_WIN32 -static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */ -{ - // Note that LONGLONG is a 64-bit value - LONGLONG ll; - - ll = Int32x32To64(t, 10000000) + 116444736000000000; - pft->dwLowDateTime = (DWORD)ll; - pft->dwHighDateTime = ll >> 32; -} -/* }}} */ - -TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */ -{ - FILETIME mtime, atime; - HANDLE hFile; - - hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, - OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL); - - /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but - the CreateFile operation succeeds */ - if (GetLastError() == ERROR_ALREADY_EXISTS) { - SetLastError(0); - } - - if ( hFile == INVALID_HANDLE_VALUE ) { - return -1; - } - - if (!buf) { - SYSTEMTIME st; - GetSystemTime(&st); - SystemTimeToFileTime(&st, &mtime); - atime = mtime; - } else { - UnixTimeToFileTime(buf->modtime, &mtime); - UnixTimeToFileTime(buf->actime, &atime); - } - if (!SetFileTime(hFile, NULL, &atime, &mtime)) { - CloseHandle(hFile); - return -1; - } - CloseHandle(hFile); - return 1; -} -/* }}} */ -#endif - CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */ { cwd_state new_state; |
