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*\<fail\>.*errno'

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2021-04-22 14:30:00 -07:00 committed by Andrei Vagin
parent 12a2bd0edd
commit 4cd23083be
6 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;
}

View file

@ -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)

View file

@ -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;

View file

@ -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;
}