summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/fadvise.c1
-rw-r--r--test/madvise.c1
-rw-r--r--test/short-read.c5
3 files changed, 6 insertions, 1 deletions
diff --git a/test/fadvise.c b/test/fadvise.c
index cb18adc..7484c7b 100644
--- a/test/fadvise.c
+++ b/test/fadvise.c
@@ -91,6 +91,7 @@ static int do_fadvise(struct io_uring *ring, int fd, off_t offset, off_t len,
ret = cqe->res;
if (ret == -EINVAL || ret == -EBADF) {
fprintf(stdout, "Fadvise not supported, skipping\n");
+ unlink(".fadvise.tmp");
exit(0);
} else if (ret) {
fprintf(stderr, "cqe->res=%d\n", cqe->res);
diff --git a/test/madvise.c b/test/madvise.c
index 1b11092..e9101c0 100644
--- a/test/madvise.c
+++ b/test/madvise.c
@@ -92,6 +92,7 @@ static int do_madvise(struct io_uring *ring, void *addr, off_t len, int advice)
ret = cqe->res;
if (ret == -EINVAL || ret == -EBADF) {
fprintf(stdout, "Madvise not supported, skipping\n");
+ unlink(".madvise.tmp");
exit(0);
} else if (ret) {
fprintf(stderr, "cqe->res=%d\n", cqe->res);
diff --git a/test/short-read.c b/test/short-read.c
index 94a148f..2519a74 100644
--- a/test/short-read.c
+++ b/test/short-read.c
@@ -34,7 +34,7 @@ static int create_file(const char *file)
int main(int argc, char *argv[])
{
- int ret, fd;
+ int ret, fd, save_errno;
struct io_uring ring;
struct io_uring_sqe *sqe;
struct io_uring_cqe *cqe;
@@ -49,6 +49,9 @@ int main(int argc, char *argv[])
}
fd = open(".short-read", O_RDONLY);
+ save_errno = errno;
+ unlink(".short-read");
+ errno = save_errno;
if (fd < 0) {
perror("file open");
return 1;