diff options
| author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
|---|---|---|
| committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
| commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
| tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch | |
| download | poky-c527fd1f14c27855a37f2e8ac5346ce8d940ced2.tar.gz | |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch')
| -rw-r--r-- | meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch new file mode 100644 index 0000000000..d17fdff455 --- /dev/null +++ b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | childinfo_t is a union that contains both signed (error) and unsigned | ||
| 2 | (threadid) members. Thus a large threadid could appear as a negative error | ||
| 3 | value, which will cause unexpected failures. | ||
| 4 | |||
| 5 | childinfo_t should be changed to a struct, but it could potentially affect the | ||
| 6 | performance. So we keep it as a union but only check error against -1. There is | ||
| 7 | still a chance of false alarm but it's small. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Song.Li <Song.Li@windriver.com> | ||
| 12 | Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> | ||
| 13 | --- | ||
| 14 | src/hackbench/hackbench.c | 4 ++-- | ||
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c | ||
| 18 | index 8baeb23..dc0de8f 100644 | ||
| 19 | --- a/src/hackbench/hackbench.c | ||
| 20 | +++ b/src/hackbench/hackbench.c | ||
| 21 | @@ -317,7 +317,7 @@ static unsigned int group(childinfo_t *child, | ||
| 22 | ctx->wakefd = wakefd; | ||
| 23 | |||
| 24 | child[tab_offset+i] = create_worker(ctx, (void *)(void *)receiver); | ||
| 25 | - if( child[tab_offset+i].error < 0 ) { | ||
| 26 | + if( child[tab_offset+i].error == -1 ) { | ||
| 27 | return (i > 0 ? i-1 : 0); | ||
| 28 | } | ||
| 29 | snd_ctx->out_fds[i] = fds[1]; | ||
| 30 | @@ -332,7 +332,7 @@ static unsigned int group(childinfo_t *child, | ||
| 31 | snd_ctx->num_fds = num_fds; | ||
| 32 | |||
| 33 | child[tab_offset+num_fds+i] = create_worker(snd_ctx, (void *)(void *)sender); | ||
| 34 | - if( child[tab_offset+num_fds+i].error < 0 ) { | ||
| 35 | + if( child[tab_offset+num_fds+i].error == -1 ) { | ||
| 36 | return (num_fds+i)-1; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | -- | ||
| 40 | 1.7.9.5 | ||
| 41 | |||
