From 05097246f352eca76207c9ebb08656c88bdf751a Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 30 Apr 2018 16:49:04 +0000 Subject: Reflow paragraphs in comments. This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197 --- .../source/Host/posix/ProcessLauncherPosixFork.cpp | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'lldb/source/Host/posix/ProcessLauncherPosixFork.cpp') diff --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp index 046cd250393..d46191fd622 100644 --- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp +++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -131,8 +131,8 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, FixupEnvironment(env); Environment::Envp envp = env.getEnvp(); - // Clear the signal mask to prevent the child from being affected by - // any masking done by the parent. + // Clear the signal mask to prevent the child from being affected by any + // masking done by the parent. sigset_t set; if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set, nullptr) != 0) @@ -142,8 +142,7 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, // HACK: // Close everything besides stdin, stdout, and stderr that has no file // action to avoid leaking. Only do this when debugging, as elsewhere we - // actually rely on - // passing open descriptors to child processes. + // actually rely on passing open descriptors to child processes. for (int fd = 3; fd < sysconf(_SC_OPEN_MAX); ++fd) if (!info.GetFileActionForFD(fd) && fd != error_fd) close(fd); @@ -158,18 +157,14 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, #if defined(__linux__) if (errno == ETXTBSY) { - // On android M and earlier we can get this error because the adb deamon can - // hold a write - // handle on the executable even after it has finished uploading it. This - // state lasts - // only a short time and happens only when there are many concurrent adb - // commands being - // issued, such as when running the test suite. (The file remains open when - // someone does - // an "adb shell" command in the fork() child before it has had a chance to - // exec.) Since - // this state should clear up quickly, wait a while and then give it one - // more go. + // On android M and earlier we can get this error because the adb deamon + // can hold a write handle on the executable even after it has finished + // uploading it. This state lasts only a short time and happens only when + // there are many concurrent adb commands being issued, such as when + // running the test suite. (The file remains open when someone does an "adb + // shell" command in the fork() child before it has had a chance to exec.) + // Since this state should clear up quickly, wait a while and then give it + // one more go. usleep(50000); execve(argv[0], const_cast(argv), envp); } -- cgit v1.2.3