From 88525617e977b2b24315e8a7bc565c2975cdf345 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 31 Jan 2023 12:16:41 -0500 Subject: tests: Use close() wrappers --- tests/mksock.c | 2 +- tests/xtouch.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/mksock.c b/tests/mksock.c index 05edbeb..42ef322 100644 --- a/tests/mksock.c +++ b/tests/mksock.c @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { ret = EXIT_FAILURE; } - if (close(fd) != 0) { + if (xclose(fd) != 0) { errmsg(cmd, path); ret = EXIT_FAILURE; } diff --git a/tests/xtouch.c b/tests/xtouch.c index 506c73d..7e29547 100644 --- a/tests/xtouch.c +++ b/tests/xtouch.c @@ -104,13 +104,11 @@ static int xtouch(const struct args *args, const char *path) { } if (futimens(fd, args->times) != 0) { - int error = errno; - close(fd); - errno = error; + close_quietly(fd); return -1; } - return close(fd); + return xclose(fd); } } -- cgit v1.2.3