From 232eb7ad09f9fd2ae4918699f850e4f8cadc2632 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 22 Oct 2013 04:36:54 -0400 Subject: exportfs: exit with error code if there was any error. exportfs currently exits with a non-zero error for some errors, but not for others. It does this by having various support routines set the global variable "export_errno". Change this to have 'xlog' set export_errno if an ERROR is reported. That way all errors will be caught. Note that the exit error code is changed from 22 (EINVAL) to the more traditional '1'. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson --- support/export/hostname.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'support/export/hostname.c') diff --git a/support/export/hostname.c b/support/export/hostname.c index 3e949a1..e53d692 100644 --- a/support/export/hostname.c +++ b/support/export/hostname.c @@ -175,10 +175,12 @@ host_addrinfo(const char *hostname) case 0: return ai; case EAI_SYSTEM: + export_errno = errno; xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m", __func__, hostname, errno); break; default: + export_errno = EINVAL; xlog(D_GENERAL, "%s: failed to resolve %s: %s", __func__, hostname, gai_strerror(error)); break; -- cgit