Skip to content

Commit 0bec80f

Browse files
committed
clang-format
1 parent 1dd09af commit 0bec80f

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

compiler-rt/lib/sanitizer_common/sanitizer_posix.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ uptr internal_ptrace(int request, int pid, void *addr, void *data);
6767
uptr internal_waitpid(int pid, int *status, int options);
6868

6969
int internal_fork();
70-
bool internal_spawn(const char *argv[], const char *envp[], pid_t *pid, fd_t stdin, fd_t stdout);
70+
bool internal_spawn(const char* argv[], const char* envp[], pid_t* pid,
71+
fd_t stdin, fd_t stdout);
7172

7273
int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
7374
uptr *oldlenp, const void *newp, uptr newlen);

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ const char *LLVMSymbolizer::FormatAndSendCommand(const char *command_prefix,
476476
return symbolizer_process_->SendCommand(buffer_);
477477
}
478478

479-
SymbolizerProcess::SymbolizerProcess(const char *path, bool use_posix_spawn)
479+
SymbolizerProcess::SymbolizerProcess(const char* path, bool use_posix_spawn)
480480
: path_(path),
481481
input_fd_(kInvalidFd),
482482
output_fd_(kInvalidFd),

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {
167167

168168
if (use_posix_spawn_) {
169169
# if SANITIZER_APPLE
170-
bool success = internal_spawn(argv, const_cast<const char **>(GetEnvP()), &pid, outfd[0], infd[1]);
170+
bool success = internal_spawn(argv, const_cast<const char**>(GetEnvP()),
171+
&pid, outfd[0], infd[1]);
171172
if (!success) {
172173
Report("WARNING: failed to spawn external symbolizer (errno: %d)\n",
173174
errno);

0 commit comments

Comments
 (0)