mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 14:52:28 +00:00
Apply clang-format update to repo (#1154)
Commit bc6c183
introduced a bunch of discrepancies between what files
look like in the repo and what clang-format says they should look like.
However, there were already a few discrepancies prior to that. Most of
these discrepancies seemed to be unintentional, but a few of them were
load-bearing (e.g., a #include that violated header ordering needing
something to have been #defined by a 'later' #include.)
I opted to take what I hope is a relatively smooth-brained approach: I
reverted the .clang-format change, ran clang-format on the whole repo,
reapplied the .clang-format change, reran clang-format again, and then
reverted the commit that contained the first run. Thus the full effect
of this PR should only be to apply the changed formatting rules to the
repo, and from skimming the results, this seems to be the case.
My work can be checked by applying the short, manual commits, and then
rerunning the command listed in the autogenerated commits (those whose
messages I have prefixed auto:) and seeing if your results agree.
It might be that the other diffs should be fixed at some point but I'm
leaving that aside for now.
fd '\.c(c|pp)?$' --print0| xargs -0 clang-format -i
This commit is contained in:
parent
342d0c81e5
commit
6e6fc38935
863 changed files with 9201 additions and 4627 deletions
|
@ -124,7 +124,8 @@ TEST(sigaction, raise) {
|
|||
// test kill()
|
||||
|
||||
TEST(sigaction, testPingPongParentChildWithSigint) {
|
||||
if (IsNetbsd()) return; // TODO: what's up with runitd on netbsd?
|
||||
if (IsNetbsd())
|
||||
return; // TODO: what's up with runitd on netbsd?
|
||||
int pid, status;
|
||||
sigset_t blockint, oldmask;
|
||||
struct sigaction oldint;
|
||||
|
@ -244,8 +245,10 @@ TEST(sigaction, ignoringSignalDiscardsSignal) {
|
|||
}
|
||||
|
||||
TEST(sigaction, autoZombieSlayer) {
|
||||
if (IsWindows()) return;
|
||||
if (IsCygwin()) return;
|
||||
if (IsWindows())
|
||||
return;
|
||||
if (IsCygwin())
|
||||
return;
|
||||
int pid;
|
||||
struct sigaction sa;
|
||||
// make sure we're starting in expected state
|
||||
|
@ -253,7 +256,8 @@ TEST(sigaction, autoZombieSlayer) {
|
|||
ASSERT_EQ(SIG_DFL, sa.sa_handler);
|
||||
// verify child becomes zombie
|
||||
ASSERT_NE(-1, (pid = fork()));
|
||||
if (!pid) _Exit(0);
|
||||
if (!pid)
|
||||
_Exit(0);
|
||||
ASSERT_SYS(0, pid, wait(0));
|
||||
// enable automatic zombie slayer
|
||||
sa.sa_handler = SIG_IGN;
|
||||
|
@ -262,17 +266,21 @@ TEST(sigaction, autoZombieSlayer) {
|
|||
ASSERT_SYS(0, 0, sigaction(SIGCHLD, &sa, &sa));
|
||||
// verify it works
|
||||
ASSERT_NE(-1, (pid = fork()));
|
||||
if (!pid) _Exit(0);
|
||||
if (!pid)
|
||||
_Exit(0);
|
||||
// XXX: WSL does the wrong thing here.
|
||||
if (__iswsl1()) usleep(10);
|
||||
if (__iswsl1())
|
||||
usleep(10);
|
||||
ASSERT_SYS(ECHILD, -1, wait(0));
|
||||
// clean up
|
||||
ASSERT_SYS(0, 0, sigaction(SIGCHLD, &sa, 0));
|
||||
}
|
||||
|
||||
TEST(sigaction, enosys_returnsErrnoRatherThanSigsysByDefault) {
|
||||
if (IsTiny()) return; // systemfive.S disables the fix w/ tiny
|
||||
if (IsOpenbsd()) return; // TODO: Why does OpenBSD raise SIGABRT?
|
||||
if (IsTiny())
|
||||
return; // systemfive.S disables the fix w/ tiny
|
||||
if (IsOpenbsd())
|
||||
return; // TODO: Why does OpenBSD raise SIGABRT?
|
||||
ASSERT_SYS(ENOSYS, -1, sys_bogus());
|
||||
}
|
||||
|
||||
|
@ -373,7 +381,8 @@ dontubsan dontasan int Segfault(char *p) {
|
|||
int (*pSegfault)(char *) = Segfault;
|
||||
|
||||
TEST(sigaction, returnFromSegvHandler_loopsForever) {
|
||||
if (IsXnu()) return; // seems busted
|
||||
if (IsXnu())
|
||||
return; // seems busted
|
||||
segfaults = _mapshared(sizeof(*segfaults));
|
||||
SPAWN(fork);
|
||||
signal(SIGSEGV, OnSegfault);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue