From a248bfdaf009cebe5426fcf12bc1bf3d6f44423e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 1 Mar 2007 23:53:51 +0000 Subject: [PATCH] * Save errno in offset_check, thanks to Sami Liedes. --- src/lib-fd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib-fd.c b/src/lib-fd.c index 236efdf..fe981c6 100644 --- a/src/lib-fd.c +++ b/src/lib-fd.c @@ -34,6 +34,7 @@ #include #include #include +#include #if defined HAVE_WINSOCK2_H # include @@ -489,9 +490,10 @@ static void fuzz_iovec(int fd, const struct iovec *iov, ssize_t ret) } #endif +/* Sanity check, can be OK though (for instance with a character device) */ static void offset_check(int fd) { - /* Sanity check, can be OK though (for instance with a character device) */ + int orig_errno = errno; #if defined HAVE_LSEEK64 off64_t ret; LOADSYM(lseek64); @@ -503,5 +505,6 @@ static void offset_check(int fd) #endif if(ret != -1 && ret != _zz_getpos(fd)) debug("warning: offset inconsistency"); + errno = orig_errno; }