summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ipc/msgque.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2014-03-10 23:49:50 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-11 01:26:21 +0100
commit53942232369ec317f77dc8c2d5a0637bb85a6e84 (patch)
treeb07f0c80c30d502118dedd8adce61c0d63dda669 /tools/testing/selftests/ipc/msgque.c
parentMAINTAINERS: blackfin: add git repository (diff)
downloadlinux-53942232369ec317f77dc8c2d5a0637bb85a6e84.tar.xz
linux-53942232369ec317f77dc8c2d5a0637bb85a6e84.zip
tools/testing/selftests/ipc/msgque.c: handle msgget failure return correctly
A failed msgget causes the test to return an uninitialised value in ret. Assign ret to -errno on error exit. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Davidlohr Bueso <davidlohr@hp.com> Cc: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/ipc/msgque.c')
-rw-r--r--tools/testing/selftests/ipc/msgque.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
index d66418237d21..aa290c0de6f5 100644
--- a/tools/testing/selftests/ipc/msgque.c
+++ b/tools/testing/selftests/ipc/msgque.c
@@ -201,6 +201,7 @@ int main(int argc, char **argv)
msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
if (msgque.msq_id == -1) {
+ err = -errno;
printf("Can't create queue\n");
goto err_out;
}