@@ -281,12 +281,13 @@ int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
281281 (size_t )newlen);
282282}
283283
284- bool internal_spawn (const char * argv[], const char * envp[],
285- pid_t *pid, fd_t fd_stdin, fd_t fd_stdout) {
286- // NOTE: Caller ensures that fd_stdin and fd_stdout are not 0, 1, or 2, since this can
287- // break communication.
284+ bool internal_spawn (const char * argv[], const char * envp[], pid_t * pid ,
285+ fd_t fd_stdin, fd_t fd_stdout) {
286+ // NOTE: Caller ensures that fd_stdin and fd_stdout are not 0, 1, or 2, since
287+ // this can break communication.
288288 //
289- // NOTE: Caller is responsible for closing fd_stdin after the process has died.
289+ // NOTE: Caller is responsible for closing fd_stdin after the process has
290+ // died.
290291
291292 int res;
292293 auto fd_closer = at_scope_exit ([&] {
@@ -298,7 +299,8 @@ bool internal_spawn(const char *argv[], const char *envp[],
298299 // File descriptor actions
299300 posix_spawn_file_actions_t acts;
300301 res = posix_spawn_file_actions_init (&acts);
301- if (res != 0 ) return false ;
302+ if (res != 0 )
303+ return false ;
302304
303305 auto acts_cleanup = at_scope_exit ([&] {
304306 posix_spawn_file_actions_destroy (&acts);
@@ -308,12 +310,14 @@ bool internal_spawn(const char *argv[], const char *envp[],
308310 posix_spawn_file_actions_adddup2 (&acts, fd_stdout, STDOUT_FILENO) ||
309311 posix_spawn_file_actions_addclose (&acts, fd_stdin) ||
310312 posix_spawn_file_actions_addclose (&acts, fd_stdout);
311- if (res != 0 ) return false ;
313+ if (res != 0 )
314+ return false ;
312315
313316 // Spawn attributes
314317 posix_spawnattr_t attrs;
315318 res = posix_spawnattr_init (&attrs);
316- if (res != 0 ) return false ;
319+ if (res != 0 )
320+ return false ;
317321
318322 auto attrs_cleanup = at_scope_exit ([&] {
319323 posix_spawnattr_destroy (&attrs);
@@ -322,13 +326,15 @@ bool internal_spawn(const char *argv[], const char *envp[],
322326 // In the spawned process, close all file descriptors that are not explicitly
323327 // described by the file actions object. This is Darwin-specific extension.
324328 res = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_CLOEXEC_DEFAULT);
325- if (res != 0 ) return false ;
329+ if (res != 0 )
330+ return false ;
326331
327332 // posix_spawn
328333 char **argv_casted = const_cast <char **>(argv);
329334 char **envp_casted = const_cast <char **>(envp);
330335 res = posix_spawn (pid, argv[0 ], &acts, &attrs, argv_casted, envp_casted);
331- if (res != 0 ) return false ;
336+ if (res != 0 )
337+ return false ;
332338
333339 return true ;
334340}
0 commit comments