mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
(Merge 3.2) posixmodule.c: fix function name in argument parsing
Fix os.fchown() and os.open() Remove also trailing spaces and replace tabs by spaces.
This commit is contained in:
commit
6ee7a57b38
1 changed files with 9 additions and 9 deletions
|
@ -1162,11 +1162,11 @@ static int
|
||||||
win32_xstat_impl(const char *path, struct win32_stat *result,
|
win32_xstat_impl(const char *path, struct win32_stat *result,
|
||||||
BOOL traverse)
|
BOOL traverse)
|
||||||
{
|
{
|
||||||
int code;
|
int code;
|
||||||
HANDLE hFile, hFile2;
|
HANDLE hFile, hFile2;
|
||||||
BY_HANDLE_FILE_INFORMATION info;
|
BY_HANDLE_FILE_INFORMATION info;
|
||||||
ULONG reparse_tag = 0;
|
ULONG reparse_tag = 0;
|
||||||
wchar_t *target_path;
|
wchar_t *target_path;
|
||||||
const char *dot;
|
const char *dot;
|
||||||
|
|
||||||
if(!check_GetFinalPathNameByHandle()) {
|
if(!check_GetFinalPathNameByHandle()) {
|
||||||
|
@ -1262,7 +1262,7 @@ win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result,
|
||||||
HANDLE hFile, hFile2;
|
HANDLE hFile, hFile2;
|
||||||
BY_HANDLE_FILE_INFORMATION info;
|
BY_HANDLE_FILE_INFORMATION info;
|
||||||
ULONG reparse_tag = 0;
|
ULONG reparse_tag = 0;
|
||||||
wchar_t *target_path;
|
wchar_t *target_path;
|
||||||
const wchar_t *dot;
|
const wchar_t *dot;
|
||||||
|
|
||||||
if(!check_GetFinalPathNameByHandle()) {
|
if(!check_GetFinalPathNameByHandle()) {
|
||||||
|
@ -1281,7 +1281,7 @@ win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result,
|
||||||
/* FILE_FLAG_OPEN_REPARSE_POINT does not follow the symlink.
|
/* FILE_FLAG_OPEN_REPARSE_POINT does not follow the symlink.
|
||||||
Because of this, calls like GetFinalPathNameByHandle will return
|
Because of this, calls like GetFinalPathNameByHandle will return
|
||||||
the symlink path agin and not the actual final path. */
|
the symlink path agin and not the actual final path. */
|
||||||
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS|
|
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS|
|
||||||
FILE_FLAG_OPEN_REPARSE_POINT,
|
FILE_FLAG_OPEN_REPARSE_POINT,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -2275,7 +2275,7 @@ posix_fchown(PyObject *self, PyObject *args)
|
||||||
int fd;
|
int fd;
|
||||||
long uid, gid;
|
long uid, gid;
|
||||||
int res;
|
int res;
|
||||||
if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid))
|
if (!PyArg_ParseTuple(args, "ill:fchown", &fd, &uid, &gid))
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
res = fchown(fd, (uid_t) uid, (gid_t) gid);
|
res = fchown(fd, (uid_t) uid, (gid_t) gid);
|
||||||
|
@ -6076,7 +6076,7 @@ posix_open(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
PyUnicodeObject *po;
|
PyUnicodeObject *po;
|
||||||
if (PyArg_ParseTuple(args, "Ui|i:mkdir", &po, &flag, &mode)) {
|
if (PyArg_ParseTuple(args, "Ui|i:open", &po, &flag, &mode)) {
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
/* PyUnicode_AS_UNICODE OK without thread
|
/* PyUnicode_AS_UNICODE OK without thread
|
||||||
lock as it is a simple dereference. */
|
lock as it is a simple dereference. */
|
||||||
|
@ -6091,7 +6091,7 @@ posix_open(PyObject *self, PyObject *args)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O&i|i",
|
if (!PyArg_ParseTuple(args, "O&i|i:open",
|
||||||
PyUnicode_FSConverter, &ofile,
|
PyUnicode_FSConverter, &ofile,
|
||||||
&flag, &mode))
|
&flag, &mode))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -8982,12 +8982,12 @@ posix_futimesat(PyObject *self, PyObject *args)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (extract_time(PyTuple_GET_ITEM(arg, 0),
|
if (extract_time(PyTuple_GET_ITEM(arg, 0),
|
||||||
&(buf[0].tv_sec), &(buf[0].tv_usec)) == -1) {
|
&(buf[0].tv_sec), &(buf[0].tv_usec)) == -1) {
|
||||||
Py_DECREF(opath);
|
Py_DECREF(opath);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (extract_time(PyTuple_GET_ITEM(arg, 1),
|
if (extract_time(PyTuple_GET_ITEM(arg, 1),
|
||||||
&(buf[1].tv_sec), &(buf[1].tv_usec)) == -1) {
|
&(buf[1].tv_sec), &(buf[1].tv_usec)) == -1) {
|
||||||
Py_DECREF(opath);
|
Py_DECREF(opath);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue