Whitespace cleanups. No code changes.
* count.c: Place opening curly brace after if (),
not on the next line. Almost all strace code alredy
uses this style.
* desc.c: Likewise.
* file.c: Likewise.
* net.c: Likewise.
* pathtrace.c: Likewise.
* process.c: Likewise.
* quota.c: Likewise.
* signal.c: Likewise.
* strace.c: Likewise.
* syscall.c: Likewise.
* time.c: Likewise.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
diff --git a/count.c b/count.c
index 92f7849..625ed4e 100644
--- a/count.c
+++ b/count.c
@@ -53,11 +53,9 @@
if (tcp->scno < 0 || tcp->scno >= nsyscalls)
return 0;
- if (!counts)
- {
+ if (!counts) {
counts = calloc(nsyscalls, sizeof(*counts));
- if (!counts)
- {
+ if (!counts) {
fprintf(stderr,
"strace: out of memory for call counts\n");
exit(1);
@@ -70,12 +68,10 @@
tv_sub(tv, tv, &tcp->etime);
#ifdef LINUX
- if (tv_cmp(tv, &tcp->dtime) > 0)
- {
+ if (tv_cmp(tv, &tcp->dtime) > 0) {
static struct timeval one_tick;
- if (one_tick.tv_usec == 0)
- {
+ if (one_tick.tv_usec == 0) {
/* Initialize it. */
struct itimerval it;
@@ -88,8 +84,7 @@
if (tv_nz(&tcp->dtime))
*tv = tcp->dtime;
- else if (tv_cmp(tv, &one_tick) > 0)
- {
+ else if (tv_cmp(tv, &one_tick) > 0) {
if (tv_cmp(&shortest, &one_tick) < 0)
*tv = shortest;
else
@@ -141,8 +136,7 @@
sortfun = syscall_cmp;
else if (strcmp(sortby, "nothing") == 0)
sortfun = NULL;
- else
- {
+ else {
fprintf(stderr, "invalid sortby: `%s'\n", sortby);
exit(1);
}
@@ -165,20 +159,17 @@
char error_str[16];
int *sorted_count = calloc(sizeof(int), nsyscalls);
- if (!sorted_count)
- {
+ if (!sorted_count) {
fprintf(stderr, "strace: out of memory for call summary\n");
return;
}
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
- if (overhead.tv_sec == -1)
- {
+ if (overhead.tv_sec == -1) {
tv_mul(&overhead, &shortest, 8);
tv_div(&overhead, &overhead, 10);
}
- for (i = 0; i < nsyscalls; i++)
- {
+ for (i = 0; i < nsyscalls; i++) {
sorted_count[i] = i;
if (counts == NULL || counts[i].calls == 0)
continue;
@@ -195,10 +186,8 @@
"calls", "errors", "syscall");
fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %-16.16s\n",
dashes, dashes, dashes, dashes, dashes, dashes);
- if (counts)
- {
- for (i = 0; i < nsyscalls; i++)
- {
+ if (counts) {
+ for (i = 0; i < nsyscalls; i++) {
j = sorted_count[i];
if (counts[j].calls == 0)
continue;
@@ -232,10 +221,9 @@
void
call_summary(FILE *outf)
{
- int i, old_pers = current_personality;
+ int i, old_pers = current_personality;
- for (i = 0; i < SUPPORTED_PERSONALITIES; ++i)
- {
+ for (i = 0; i < SUPPORTED_PERSONALITIES; ++i) {
if (!countv[i])
continue;