logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: b15084fa91fb6f68b75187f03c87b1b666dcb582
parent 33d2927e3e888a824e39b034d030eaf8a144278c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 25 Nov 2024 01:51:27 +0100

lib/fs: reset errno in file_sync() wrapper

Diffstat:

Mlib/fs.c6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/fs.c b/lib/fs.c @@ -66,7 +66,11 @@ file_sync(int fd) if(ret == 0) return 0; // Ignored cases - if(errno == EROFS || errno == EINVAL) return 0; + if(errno == EROFS || errno == EINVAL) + { + errno = 0; + return 0; + } return ret; }