Skip to content
Snippets Groups Projects
Commit 084d678e authored by Florian Fischer's avatar Florian Fischer
Browse files

[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
parent c3b57183
No related branches found
No related tags found
1 merge request!205Fix most llvm-12 clang-tidy warnings in IO code
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment