Skip to content

Commit

Permalink
Fix occasional segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
rigtorp committed Mar 15, 2010
1 parent eb8dccc commit d15824c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pipe_lat.c
Expand Up @@ -86,7 +86,7 @@ int main(int argc, char *argv[])
}
} else { /* parent */

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {

Expand All @@ -102,7 +102,7 @@ int main(int argc, char *argv[])

}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1000000 +
stop.tv_usec - start.tv_usec);
Expand Down
4 changes: 2 additions & 2 deletions pipe_thr.c
Expand Up @@ -77,7 +77,7 @@ int main(int argc, char *argv[])
} else {
/* parent */

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {
if (write(fds[1], buf, size) != size) {
Expand All @@ -86,7 +86,7 @@ int main(int argc, char *argv[])
}
}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
Expand Down
4 changes: 2 additions & 2 deletions tcp_lat.c
Expand Up @@ -139,7 +139,7 @@ int main(int argc, char *argv[])
exit(1);
}

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {

Expand All @@ -159,7 +159,7 @@ int main(int argc, char *argv[])

}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
Expand Down
4 changes: 2 additions & 2 deletions tcp_thr.c
Expand Up @@ -139,7 +139,7 @@ int main(int argc, char *argv[])
exit(1);
}

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {
if (write(sockfd, buf, size) != size) {
Expand All @@ -148,7 +148,7 @@ int main(int argc, char *argv[])
}
}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
Expand Down
4 changes: 2 additions & 2 deletions unix_lat.c
Expand Up @@ -79,7 +79,7 @@ int main(int argc, char *argv[])
}
} else { /* parent */

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {

Expand All @@ -95,7 +95,7 @@ int main(int argc, char *argv[])

}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
Expand Down
4 changes: 2 additions & 2 deletions unix_thr.c
Expand Up @@ -76,7 +76,7 @@ int main(int argc, char *argv[])
} else {
/* parent */

gettimeofday(&start);
gettimeofday(&start, NULL);

for (i = 0; i < count; i++) {
if (write(fds[0], buf, size) != size) {
Expand All @@ -85,7 +85,7 @@ int main(int argc, char *argv[])
}
}

gettimeofday(&stop);
gettimeofday(&stop, NULL);

delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
Expand Down

0 comments on commit d15824c

Please sign in to comment.