From e72d258d0d70fe036a5814c1a13975302cab3f17 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 11 Mar 2014 12:27:52 -0400 Subject: nfsidmap: fix error reporting for nfs4_* family of functions Errors were logged with xlog_err function relying on errno, but these functions don't set it. Fix the problem by introducing xlog_errno which set errno Signed-off-by: Mateusz Guzik Signed-off-by: Steve Dickson --- support/nfs/xlog.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'support/nfs/xlog.c') diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c index 83d07e1..594ae9b 100644 --- a/support/nfs/xlog.c +++ b/support/nfs/xlog.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "nfslib.h" #undef VERBOSE_PRINTF @@ -220,3 +221,14 @@ xlog_err(const char* fmt, ...) xlog_backend(L_FATAL, fmt, args); va_end(args); } + +void +xlog_errno(int err, const char *fmt, ...) +{ + va_list args; + + errno = err; + va_start(args, fmt); + xlog_backend(L_FATAL, fmt, args); + va_end(args); +} -- cgit