summaryrefslogtreecommitdiffstats
path: root/support/nfs/xlog.c
diff options
context:
space:
mode:
authorMateusz Guzik <mguzik@redhat.com>2014-03-11 12:27:52 -0400
committerSteve Dickson <steved@redhat.com>2014-03-11 14:05:35 -0400
commite72d258d0d70fe036a5814c1a13975302cab3f17 (patch)
tree276647a75730ff1e533ec9f962434583b2687c92 /support/nfs/xlog.c
parent2204097a0a960c88658e28a688eca58c9c5722e4 (diff)
downloadnfs-utils-e72d258d0d70fe036a5814c1a13975302cab3f17.tar.gz
nfs-utils-e72d258d0d70fe036a5814c1a13975302cab3f17.tar.xz
nfs-utils-e72d258d0d70fe036a5814c1a13975302cab3f17.zip
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 <mguzik@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs/xlog.c')
-rw-r--r--support/nfs/xlog.c12
1 files changed, 12 insertions, 0 deletions
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 <stdio.h>
#include <stdarg.h>
#include <syslog.h>
+#include <errno.h>
#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);
+}