diff options
author | David Sommerseth <davids@redhat.com> | 2010-02-18 15:51:10 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2010-02-18 15:51:10 +0100 |
commit | bd588c92b8bae59e3404fc3c90283e98c9f0a96e (patch) | |
tree | c0325b5fa78de4d63b408f10e55a829a0b031fa3 | |
parent | fbd80c495bd861545713279d5f96f1e4770d6911 (diff) | |
download | rt-tests-bd588c92b8bae59e3404fc3c90283e98c9f0a96e.tar.gz |
Fixed a few compiler and valgrind warnings
Valgrind complained about usage of non-initialised data. The compiler
complained about the out_fds argument being unsigned int when calling
sender().
Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r-- | src/hackbench/Makefile | 2 | ||||
-rw-r--r-- | src/hackbench/hackbench.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/hackbench/Makefile b/src/hackbench/Makefile index 3465852..d3672b5 100644 --- a/src/hackbench/Makefile +++ b/src/hackbench/Makefile @@ -1,2 +1,2 @@ hackbench: hackbench.c - $(CC) $(CFLAGS) -o hackbench hackbench.c + $(CC) $(CFLAGS) -o hackbench hackbench.c -g -Wall diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c index 38a5e54..dfc71d8 100644 --- a/src/hackbench/hackbench.c +++ b/src/hackbench/hackbench.c @@ -35,7 +35,7 @@ static void fdpair(int fds[2]) /* Block until we're ready to go */ static void ready(int ready_out, int wakefd) { - char dummy; + char dummy = '*'; struct pollfd pollfd = { .fd = wakefd, .events = POLLIN }; /* Tell them we're ready. */ @@ -57,6 +57,7 @@ static void sender(unsigned int num_fds, unsigned int i, j; ready(ready_out, wakefd); + memset(&data, '-', DATASIZE); /* Now pump to every receiver. */ for (i = 0; i < loops; i++) { @@ -108,7 +109,7 @@ static unsigned int group(unsigned int num_fds, unsigned int childp_offset) { unsigned int i; - unsigned int out_fds[num_fds]; + int out_fds[num_fds]; unsigned int children_started = 0; for (i = 0; i < num_fds ; i++) { |