From 4cd23083bedaab42d5be8d6a89d05b3212697452 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 22 Apr 2021 14:30:00 -0700 Subject: [PATCH] test/zdtm: don't pass errno to fail() Macro fail() already prints the value of errno, so there's no need to explicitly add it. Found by git grep '^\s*\.*errno' Signed-off-by: Kir Kolyshkin --- test/zdtm/static/file_locks05.c | 2 +- test/zdtm/static/msgque.c | 2 +- test/zdtm/static/s390x_runtime_instr.c | 2 +- test/zdtm/static/shm.c | 4 ++-- test/zdtm/static/socket-tcp-close0.c | 2 +- test/zdtm/static/sockets02.c | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/zdtm/static/file_locks05.c b/test/zdtm/static/file_locks05.c index 33877f842..e9e56acfe 100644 --- a/test/zdtm/static/file_locks05.c +++ b/test/zdtm/static/file_locks05.c @@ -40,7 +40,7 @@ int main(int argc, char **argv) if (flock(fd2, LOCK_SH) == 0) pass(); else - fail("Flock file locks check failed (%d)", errno); + fail("Flock file locks check failed"); close(fd); close(fd2); diff --git a/test/zdtm/static/msgque.c b/test/zdtm/static/msgque.c index 55f81792f..f52307221 100644 --- a/test/zdtm/static/msgque.c +++ b/test/zdtm/static/msgque.c @@ -123,7 +123,7 @@ int main(int argc, char **argv) out: if (msgctl(msg, IPC_RMID, 0)) { - fail("Failed to destroy message queue: %d", -errno); + fail("Failed to destroy message queue"); return -errno; } return chret; diff --git a/test/zdtm/static/s390x_runtime_instr.c b/test/zdtm/static/s390x_runtime_instr.c index e0a5742d9..ff692d7c6 100644 --- a/test/zdtm/static/s390x_runtime_instr.c +++ b/test/zdtm/static/s390x_runtime_instr.c @@ -150,7 +150,7 @@ int main(int argc, char **argv) free(buf); return 0; } - fail("Fail with error %d", errno); + fail("syscall(s390_runtime_instr) failed"); free(buf); return -1; } diff --git a/test/zdtm/static/shm.c b/test/zdtm/static/shm.c index 7e7d9570b..320211bfc 100644 --- a/test/zdtm/static/shm.c +++ b/test/zdtm/static/shm.c @@ -162,7 +162,7 @@ int main(int argc, char **argv) ret = shmctl(shm, IPC_RMID, NULL); if (ret < 0) { - fail("Failed (1) to destroy segment: %d", -errno); + fail("Failed (1) to destroy segment"); fail_count++; goto out_shm; } @@ -187,7 +187,7 @@ int main(int argc, char **argv) out_shm: ret = shmctl(shm, IPC_RMID, NULL); if (ret < 0) { - fail("Failed (2) to destroy segment: %d", -errno); + fail("Failed (2) to destroy segment"); fail_count++; } if (fail_count == 0) diff --git a/test/zdtm/static/socket-tcp-close0.c b/test/zdtm/static/socket-tcp-close0.c index a411b6e0d..367e40473 100644 --- a/test/zdtm/static/socket-tcp-close0.c +++ b/test/zdtm/static/socket-tcp-close0.c @@ -56,7 +56,7 @@ static int check_socket_closed(int sk) } if (errno != EPIPE) { - fail("errno is %d (%s) (expected EPIPE)", errno, strerror(errno)); + fail("wrong errno (expected EPIPE)"); return 1; } return 0; diff --git a/test/zdtm/static/sockets02.c b/test/zdtm/static/sockets02.c index 5819e76af..a227c88ae 100644 --- a/test/zdtm/static/sockets02.c +++ b/test/zdtm/static/sockets02.c @@ -49,14 +49,14 @@ int main(int argc, char *argv[]) errno = 0; ret = read(ssk_pair[0], &aux, sizeof(aux)); if (ret != 0 || errno != 0) { - fail("Opened end in wrong state (%d/%d)", ret, errno); + fail("Opened end in wrong state (ret=%d)", ret); return 0; } errno = 0; ret = read(ssk_pair[1], &aux, sizeof(aux)); if (ret != -1 || errno != EBADF) { - fail("Closed end in wrong state (%d/%d)", ret, errno); + fail("Closed end in wrong state (ret=%d)", ret); return 0; }