Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0e803b33
Commit
0e803b33
authored
Nov 26, 2010
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further indentation cleanup.
parent
99439266
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
Modules/posixmodule.c
Modules/posixmodule.c
+49
-49
No files found.
Modules/posixmodule.c
View file @
0e803b33
...
...
@@ -2050,7 +2050,7 @@ force write of file with filedescriptor to disk.");
static
PyObject
*
posix_fsync
(
PyObject
*
self
,
PyObject
*
fdobj
)
{
return
posix_fildes
(
fdobj
,
fsync
);
return
posix_fildes
(
fdobj
,
fsync
);
}
#endif
/* HAVE_FSYNC */
...
...
@@ -2068,7 +2068,7 @@ force write of file with filedescriptor to disk.\n\
static
PyObject
*
posix_fdatasync
(
PyObject
*
self
,
PyObject
*
fdobj
)
{
return
posix_fildes
(
fdobj
,
fdatasync
);
return
posix_fildes
(
fdobj
,
fdatasync
);
}
#endif
/* HAVE_FDATASYNC */
...
...
@@ -2549,7 +2549,7 @@ posix_listdir(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|O&:listdir"
,
PyUnicode_FSConverter
,
&
oname
))
return
NULL
;
if
(
oname
==
NULL
)
{
/* Default arg: "." */
oname
=
PyBytes_FromString
(
"."
);
oname
=
PyBytes_FromString
(
"."
);
}
name
=
PyBytes_AsString
(
oname
);
Py_BEGIN_ALLOW_THREADS
...
...
@@ -3188,7 +3188,7 @@ posix_utime(PyObject *self, PyObject *args)
!
SystemTimeToFileTime
(
&
now
,
&
atime
))
{
win32_error
(
"utime"
,
NULL
);
goto
done
;
}
}
}
else
if
(
!
PyTuple_Check
(
arg
)
||
PyTuple_Size
(
arg
)
!=
2
)
{
PyErr_SetString
(
PyExc_TypeError
,
...
...
@@ -4256,9 +4256,9 @@ posix_getgroups(PyObject *self, PyObject *noargs)
for
(
i
=
0
;
i
<
n
;
++
i
)
{
PyObject
*
o
=
PyLong_FromLong
((
long
)
alt_grouplist
[
i
]);
if
(
o
==
NULL
)
{
Py_DECREF
(
result
);
result
=
NULL
;
break
;
Py_DECREF
(
result
);
result
=
NULL
;
break
;
}
PyList_SET_ITEM
(
result
,
i
,
o
);
}
...
...
@@ -6362,38 +6362,38 @@ conv_confname(PyObject *arg, int *valuep, struct constdef *table,
size_t
tablesize
)
{
if
(
PyLong_Check
(
arg
))
{
*
valuep
=
PyLong_AS_LONG
(
arg
);
return
1
;
*
valuep
=
PyLong_AS_LONG
(
arg
);
return
1
;
}
else
{
/* look up the value in the table using a binary search */
size_t
lo
=
0
;
size_t
mid
;
size_t
hi
=
tablesize
;
int
cmp
;
const
char
*
confname
;
if
(
!
PyUnicode_Check
(
arg
))
{
PyErr_SetString
(
PyExc_TypeError
,
"configuration names must be strings or integers"
);
return
0
;
}
confname
=
_PyUnicode_AsString
(
arg
);
if
(
confname
==
NULL
)
return
0
;
while
(
lo
<
hi
)
{
mid
=
(
lo
+
hi
)
/
2
;
cmp
=
strcmp
(
confname
,
table
[
mid
].
name
);
if
(
cmp
<
0
)
hi
=
mid
;
else
if
(
cmp
>
0
)
lo
=
mid
+
1
;
else
{
*
valuep
=
table
[
mid
].
value
;
return
1
;
/* look up the value in the table using a binary search */
size_t
lo
=
0
;
size_t
mid
;
size_t
hi
=
tablesize
;
int
cmp
;
const
char
*
confname
;
if
(
!
PyUnicode_Check
(
arg
))
{
PyErr_SetString
(
PyExc_TypeError
,
"configuration names must be strings or integers"
);
return
0
;
}
}
PyErr_SetString
(
PyExc_ValueError
,
"unrecognized configuration name"
);
return
0
;
confname
=
_PyUnicode_AsString
(
arg
);
if
(
confname
==
NULL
)
return
0
;
while
(
lo
<
hi
)
{
mid
=
(
lo
+
hi
)
/
2
;
cmp
=
strcmp
(
confname
,
table
[
mid
].
name
);
if
(
cmp
<
0
)
hi
=
mid
;
else
if
(
cmp
>
0
)
lo
=
mid
+
1
;
else
{
*
valuep
=
table
[
mid
].
value
;
return
1
;
}
}
PyErr_SetString
(
PyExc_ValueError
,
"unrecognized configuration name"
);
return
0
;
}
}
...
...
@@ -6509,14 +6509,14 @@ posix_fpathconf(PyObject *self, PyObject *args)
if
(
PyArg_ParseTuple
(
args
,
"iO&:fpathconf"
,
&
fd
,
conv_path_confname
,
&
name
))
{
long
limit
;
long
limit
;
errno
=
0
;
limit
=
fpathconf
(
fd
,
name
);
if
(
limit
==
-
1
&&
errno
!=
0
)
posix_error
();
else
result
=
PyLong_FromLong
(
limit
);
errno
=
0
;
limit
=
fpathconf
(
fd
,
name
);
if
(
limit
==
-
1
&&
errno
!=
0
)
posix_error
();
else
result
=
PyLong_FromLong
(
limit
);
}
return
result
;
}
...
...
@@ -7343,21 +7343,21 @@ setup_confname_tables(PyObject *module)
sizeof
(
posix_constants_pathconf
)
/
sizeof
(
struct
constdef
),
"pathconf_names"
,
module
))
return
-
1
;
return
-
1
;
#endif
#ifdef HAVE_CONFSTR
if
(
setup_confname_table
(
posix_constants_confstr
,
sizeof
(
posix_constants_confstr
)
/
sizeof
(
struct
constdef
),
"confstr_names"
,
module
))
return
-
1
;
return
-
1
;
#endif
#ifdef HAVE_SYSCONF
if
(
setup_confname_table
(
posix_constants_sysconf
,
sizeof
(
posix_constants_sysconf
)
/
sizeof
(
struct
constdef
),
"sysconf_names"
,
module
))
return
-
1
;
return
-
1
;
#endif
return
0
;
}
...
...
@@ -7470,10 +7470,10 @@ posix_getloadavg(PyObject *self, PyObject *noargs)
{
double
loadavg
[
3
];
if
(
getloadavg
(
loadavg
,
3
)
!=
3
)
{
PyErr_SetString
(
PyExc_OSError
,
"Load averages are unobtainable"
);
return
NULL
;
PyErr_SetString
(
PyExc_OSError
,
"Load averages are unobtainable"
);
return
NULL
;
}
else
return
Py_BuildValue
(
"ddd"
,
loadavg
[
0
],
loadavg
[
1
],
loadavg
[
2
]);
return
Py_BuildValue
(
"ddd"
,
loadavg
[
0
],
loadavg
[
1
],
loadavg
[
2
]);
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment