From 084d678eefc18b90f39d2697ec95055bf772d1a8 Mon Sep 17 00:00:00 2001 From: Florian Fischer <florian.fischer@muhq.space> Date: Mon, 17 May 2021 19:59:42 +0200 Subject: [PATCH] [io.hpp] fix openAndWait and closeAndWait definitions The posix versions (close/openat) return int as well. And this fixes a narrowing conversion in c_emper.cpp: emper_openat and emper_close --- emper/io.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emper/io.hpp b/emper/io.hpp index 64efb93f..b75f31cb 100644 --- a/emper/io.hpp +++ b/emper/io.hpp @@ -370,7 +370,7 @@ inline auto writevAndWait(int fildes, const struct iovec *iov, int iovcnt) -> ss * * @return fd on success, -1 on error */ -inline auto openatAndWait(int dirfd, const char *pathname, int flags, mode_t mode = 0) -> size_t { +inline auto openatAndWait(int dirfd, const char *pathname, int flags, mode_t mode = 0) -> int { OpenatFuture future(dirfd, pathname, flags, mode); future.submit(); return future.waitAndSetErrno(); @@ -407,7 +407,7 @@ inline auto openatAndWait(int dirfd, const char *pathname, int flags, mode_t mod * * @return fd on success, -1 on error */ -inline auto openAndWait(const char *pathname, int flags, mode_t mode = 0) -> size_t { +inline auto openAndWait(const char *pathname, int flags, mode_t mode = 0) -> int { OpenatFuture future(AT_FDCWD, pathname, flags, mode); future.submit(); return future.waitAndSetErrno(); @@ -439,7 +439,7 @@ inline auto openAndWait(const char *pathname, int flags, mode_t mode = 0) -> siz * * @return 0 on success, -1 on error */ -inline auto closeAndWait(int fd) -> ssize_t { +inline auto closeAndWait(int fd) -> int { CloseFuture future(fd); future.submit(); return future.waitAndSetErrno(); -- GitLab