Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91eef98

Browse files
committed
fix declaration style
1 parent beca27a commit 91eef98

1 file changed

Lines changed: 31 additions & 24 deletions

File tree

Modules/_posixsubprocess.c

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static long max_fd;
4343

4444

4545
/* Given the gc module call gc.enable() and return 0 on success. */
46-
static int _enable_gc(PyObject *gc_module)
46+
static int
47+
_enable_gc(PyObject *gc_module)
4748
{
4849
PyObject *result;
4950
result = PyObject_CallMethod(gc_module, "enable", NULL);
@@ -55,7 +56,8 @@ static int _enable_gc(PyObject *gc_module)
5556

5657

5758
/* Convert ASCII to a positive int, no libc call. no overflow. -1 on error. */
58-
static int _pos_int_from_ascii(char *name)
59+
static int
60+
_pos_int_from_ascii(char *name)
5961
{
6062
int num = 0;
6163
while (*name >= '0' && *name <= '9') {
@@ -75,7 +77,8 @@ static int _pos_int_from_ascii(char *name)
7577
* mounted) and do not have fdescfs for /dev/fd. MacOS X has a devfs
7678
* that properly supports /dev/fd.
7779
*/
78-
static int _is_fdescfs_mounted_on_dev_fd()
80+
static int
81+
_is_fdescfs_mounted_on_dev_fd()
7982
{
8083
struct stat dev_stat;
8184
struct stat dev_fd_stat;
@@ -91,7 +94,8 @@ static int _is_fdescfs_mounted_on_dev_fd()
9194

9295

9396
/* Returns 1 if there is a problem with fd_sequence, 0 otherwise. */
94-
static int _sanity_check_python_fd_sequence(PyObject *fd_sequence)
97+
static int
98+
_sanity_check_python_fd_sequence(PyObject *fd_sequence)
9599
{
96100
Py_ssize_t seq_idx, seq_len = PySequence_Length(fd_sequence);
97101
long prev_fd = -1;
@@ -108,7 +112,8 @@ static int _sanity_check_python_fd_sequence(PyObject *fd_sequence)
108112

109113

110114
/* Is fd found in the sorted Python Sequence? */
111-
static int _is_fd_in_sorted_fd_sequence(int fd, PyObject *fd_sequence)
115+
static int
116+
_is_fd_in_sorted_fd_sequence(int fd, PyObject *fd_sequence)
112117
{
113118
/* Binary search. */
114119
Py_ssize_t search_min = 0;
@@ -135,8 +140,8 @@ static int _is_fd_in_sorted_fd_sequence(int fd, PyObject *fd_sequence)
135140
* range defined by [start_fd, end_fd) is large this will take a
136141
* long time as it calls close() on EVERY possible fd.
137142
*/
138-
static void _close_fds_by_brute_force(int start_fd, int end_fd,
139-
PyObject *py_fds_to_keep)
143+
static void
144+
_close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep)
140145
{
141146
Py_ssize_t num_fds_to_keep = PySequence_Length(py_fds_to_keep);
142147
Py_ssize_t keep_seq_idx;
@@ -191,8 +196,8 @@ struct linux_dirent {
191196
* should be easy to add OS specific dirent or dirent64 structures and modify
192197
* it with some cpp #define magic to work on other OSes as well if you want.
193198
*/
194-
static void _close_open_fd_range_safe(int start_fd, int end_fd,
195-
PyObject* py_fds_to_keep)
199+
static void
200+
_close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
196201
{
197202
int fd_dir_fd;
198203
if (start_fd >= end_fd)
@@ -243,8 +248,9 @@ static void _close_open_fd_range_safe(int start_fd, int end_fd,
243248
* implemented as readdir() followed by memcpy(). See also:
244249
* http://womble.decadent.org.uk/readdir_r-advisory.html
245250
*/
246-
static void _close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
247-
PyObject* py_fds_to_keep)
251+
static void
252+
_close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
253+
PyObject* py_fds_to_keep)
248254
{
249255
DIR *proc_fd_dir;
250256
#ifndef HAVE_DIRFD
@@ -315,19 +321,20 @@ static void _close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
315321
* This restriction is documented at
316322
* http://www.opengroup.org/onlinepubs/009695399/functions/fork.html.
317323
*/
318-
static void child_exec(char *const exec_array[],
319-
char *const argv[],
320-
char *const envp[],
321-
const char *cwd,
322-
int p2cread, int p2cwrite,
323-
int c2pread, int c2pwrite,
324-
int errread, int errwrite,
325-
int errpipe_read, int errpipe_write,
326-
int close_fds, int restore_signals,
327-
int call_setsid,
328-
PyObject *py_fds_to_keep,
329-
PyObject *preexec_fn,
330-
PyObject *preexec_fn_args_tuple)
324+
static void
325+
child_exec(char *const exec_array[],
326+
char *const argv[],
327+
char *const envp[],
328+
const char *cwd,
329+
int p2cread, int p2cwrite,
330+
int c2pread, int c2pwrite,
331+
int errread, int errwrite,
332+
int errpipe_read, int errpipe_write,
333+
int close_fds, int restore_signals,
334+
int call_setsid,
335+
PyObject *py_fds_to_keep,
336+
PyObject *preexec_fn,
337+
PyObject *preexec_fn_args_tuple)
331338
{
332339
int i, saved_errno, unused;
333340
PyObject *result;

0 commit comments

Comments
 (0)