mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-28 12:57:57 +00:00
clang-format/zdtm: fix clang complains about strange elseifs
Clang-format v13 on my Fedora 35 complains about these hunks, more over reading the formating we had before is a pain: } else /* comment */ if (smth) { fail("") return -1; } Let's make explicit {} braces for else, this way it looks much better. Fixes: 93dd984ca ("Run 'make indent' on all C files") Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
d2b6faf8fd
commit
781676f102
@ -44,11 +44,13 @@ static int check_prot(char *ptr, int prot)
|
|||||||
fail("PROT_READ bypassed");
|
fail("PROT_READ bypassed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else /* we come here on return from SIGSEGV handler */
|
} else {
|
||||||
|
/* we come here on return from SIGSEGV handler */
|
||||||
if (prot & PROT_READ) {
|
if (prot & PROT_READ) {
|
||||||
fail("PROT_READ rejected");
|
fail("PROT_READ rejected");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!sigsetjmp(segv_ret, 1)) {
|
if (!sigsetjmp(segv_ret, 1)) {
|
||||||
ptr[20] = 67;
|
ptr[20] = 67;
|
||||||
@ -56,11 +58,13 @@ static int check_prot(char *ptr, int prot)
|
|||||||
fail("PROT_WRITE bypassed");
|
fail("PROT_WRITE bypassed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else /* we come here on return from SIGSEGV handler */
|
} else {
|
||||||
|
/* we come here on return from SIGSEGV handler */
|
||||||
if (prot & PROT_WRITE) {
|
if (prot & PROT_WRITE) {
|
||||||
fail("PROT_WRITE rejected");
|
fail("PROT_WRITE rejected");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (signal(SIGSEGV, SIG_DFL) == SIG_ERR) {
|
if (signal(SIGSEGV, SIG_DFL) == SIG_ERR) {
|
||||||
fail("restoring SIGSEGV handler failed");
|
fail("restoring SIGSEGV handler failed");
|
||||||
|
@ -33,11 +33,13 @@ static int check_prot(char *ptr, char val, int prot)
|
|||||||
fail("PROT_READ bypassed");
|
fail("PROT_READ bypassed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else /* we come here on return from SIGSEGV handler */
|
} else {
|
||||||
|
/* we come here on return from SIGSEGV handler */
|
||||||
if (prot & PROT_READ) {
|
if (prot & PROT_READ) {
|
||||||
fail("PROT_READ rejected");
|
fail("PROT_READ rejected");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!sigsetjmp(segv_ret, 1)) {
|
if (!sigsetjmp(segv_ret, 1)) {
|
||||||
*ptr = val;
|
*ptr = val;
|
||||||
@ -45,11 +47,13 @@ static int check_prot(char *ptr, char val, int prot)
|
|||||||
fail("PROT_WRITE bypassed");
|
fail("PROT_WRITE bypassed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else /* we come here on return from SIGSEGV handler */
|
} else {
|
||||||
|
/* we come here on return from SIGSEGV handler */
|
||||||
if (prot & PROT_WRITE) {
|
if (prot & PROT_WRITE) {
|
||||||
fail("PROT_WRITE rejected");
|
fail("PROT_WRITE rejected");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (signal(SIGSEGV, SIG_DFL) == SIG_ERR) {
|
if (signal(SIGSEGV, SIG_DFL) == SIG_ERR) {
|
||||||
fail("restoring SIGSEGV handler failed");
|
fail("restoring SIGSEGV handler failed");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user