Don't read errno unless the syscall failed in mq_notify01 test
commitac7f0ecd086a0014747b5dbb17f0717fdae5b460
authorJiri Palecek <jirka@debian.(none)>
Tue, 19 Jan 2010 00:08:38 +0000 (19 01:08 +0100)
committerJiri Palecek <jirka@debian.(none)>
Wed, 20 Jan 2010 01:17:00 +0000 (20 02:17 +0100)
treebb5c3e2b4fdab4cc418f92dce6fa3b11945c4977
parent24e1265f9f57ecd9523593ebe5705709db0f4214
Don't read errno unless the syscall failed in mq_notify01 test

 I've seen failures reporting "return value=0, errno=EACCESS" in the
mq_notify01 test. This is because the syscall actually succeeded (as
expected by the test), but, as it is implemented by a library
function, some of the (more) syscalls it invoked failed. The POSIX
specification of errno says it should only be read when the call in
question failed - therefore, this patch hardcodes errno 0 when return
value is 0.

 Also, this patch removes a useless TEST macro usage in a place the
TEST_RETURN nor TEST_ERRNO variables are never checked.
testcases/kernel/syscalls/mq_notify/mq_notify01.c