diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-02-21 23:26:02 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-02-21 23:26:02 (GMT) |
commit | bf1f376b3ead24b382ed9ad12b4a904116d5bc33 (patch) | |
tree | d4634e813e34c0e68224c0aa86307b752bc189c0 | |
parent | a2af1a5a5a73064328246f6c2b2233365e54acf3 (diff) | |
download | cpython-bf1f376b3ead24b382ed9ad12b4a904116d5bc33.zip cpython-bf1f376b3ead24b382ed9ad12b4a904116d5bc33.tar.gz cpython-bf1f376b3ead24b382ed9ad12b4a904116d5bc33.tar.bz2 |
Issue #23152: Renames time_t_to_FILE_TIME to _Py_time_t_to_FILE_TIME, removes unused struct win32_stat and return value
-rw-r--r-- | Modules/posixmodule.c | 26 | ||||
-rw-r--r-- | Python/fileutils.c | 6 |
2 files changed, 6 insertions, 26 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 48738bd..0d3fe57 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1451,24 +1451,6 @@ win32_wchdir(LPCWSTR path) #define HAVE_STAT_NSEC 1 #define HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES 1 -struct win32_stat{ - unsigned long st_dev; - __int64 st_ino; - unsigned short st_mode; - int st_nlink; - int st_uid; - int st_gid; - unsigned long st_rdev; - __int64 st_size; - time_t st_atime; - int st_atime_nsec; - time_t st_mtime; - int st_mtime_nsec; - time_t st_ctime; - int st_ctime_nsec; - unsigned long st_file_attributes; -}; - static BOOL attributes_from_dir(LPCSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *reparse_tag) { @@ -1579,7 +1561,7 @@ get_target_path(HANDLE hdl, wchar_t **target_path) } /* defined in fileutils.c */ -int +void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, struct _Py_stat_struct *result); static int @@ -6221,7 +6203,7 @@ exit: #ifdef MS_WINDOWS void -time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr); +_Py_time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr); #endif static PyObject * @@ -6327,8 +6309,8 @@ os_utime_impl(PyModuleDef *module, path_t *path, PyObject *times, PyObject *ns, atime = mtime; } else { - time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime); - time_t_to_FILE_TIME(utime.mtime_s, utime.mtime_ns, &mtime); + _Py_time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime); + _Py_time_t_to_FILE_TIME(utime.mtime_s, utime.mtime_ns, &mtime); } if (!SetFileTime(hFile, NULL, &atime, &mtime)) { /* Avoid putting the file name into the error here, diff --git a/Python/fileutils.c b/Python/fileutils.c index bf99e2d..e7111c1 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -563,7 +563,7 @@ FILE_TIME_to_time_t_nsec(FILETIME *in_ptr, time_t *time_out, int* nsec_out) } void -time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr) +_Py_time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr) { /* XXX endianness */ __int64 out; @@ -591,7 +591,7 @@ attributes_to_mode(DWORD attr) return m; } -int +void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, struct _Py_stat_struct *result) { memset(result, 0, sizeof(*result)); @@ -611,8 +611,6 @@ _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, result->st_mode |= S_IFLNK; } result->st_file_attributes = info->dwFileAttributes; - - return 0; } #endif |