Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169611
b: refs/heads/master
c: 5ff0cfc
h: refs/heads/master
i:
  169609: 5dbcc1d
  169607: 0b1e7d7
v: v3
  • Loading branch information
Hitoshi Mitake authored and Ingo Molnar committed Nov 9, 2009
1 parent 939e1ba commit 2fce635
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfde82ef51e3ea6ab8634d0fdbf5adcdd1b429cb
refs/heads/master: 5ff0cfc67f00fe0feaa1da0b2359232ea4aa0ee7
10 changes: 7 additions & 3 deletions trunk/tools/perf/bench/sched-pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <errno.h>
#include <assert.h>
#include <sys/time.h>
#include <sys/types.h>

#define LOOPS_DEFAULT 1000000
static int loops = LOOPS_DEFAULT;
Expand Down Expand Up @@ -58,8 +59,8 @@ int bench_sched_pipe(int argc, const char **argv,
* discarding returned value of read(), write()
* causes error in building environment for perf
*/
int ret;
pid_t pid;
int ret, wait_stat;
pid_t pid, retpid;

argc = parse_options(argc, argv, options,
bench_sched_pipe_usage, 0);
Expand Down Expand Up @@ -87,8 +88,11 @@ int bench_sched_pipe(int argc, const char **argv,
gettimeofday(&stop, NULL);
timersub(&stop, &start, &diff);

if (pid)
if (pid) {
retpid = waitpid(pid, &wait_stat, 0);
assert((retpid == pid) && WIFEXITED(wait_stat));
return 0;
}

if (simple)
printf("%lu.%03lu\n",
Expand Down

0 comments on commit 2fce635

Please sign in to comment.