From 5c1ed7f18f81faa3619ac47f3e0a1f4e343c94ce Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 26 Jun 2015 13:17:01 +0200 Subject: [PATCH] ctdbd_conn: use the right error code from ctdbd_connect for debug and return MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ctdbd_connect() explicitly returns the errno. Using errno instead of ret misses some important manually set return values and might use the errno that is changed by close(fd). Signed-off-by: Michael Adam Reviewed-by: Guenther Deschner Reviewed-by: Volker Lendecke Autobuild-User(master): Günther Deschner Autobuild-Date(master): Fri Jun 26 17:21:26 CEST 2015 on sn-devel-104 --- source3/lib/ctdbd_conn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 962ab434743..fae086a2be6 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -458,8 +458,8 @@ static NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, ret = ctdbd_connect(&conn->fd); if (ret != 0) { - status = map_nt_error_from_unix(errno); - DEBUG(1, ("ctdbd_connect failed: %s\n", strerror(errno))); + status = map_nt_error_from_unix(ret); + DEBUG(1, ("ctdbd_connect failed: %s\n", strerror(ret))); goto fail; } talloc_set_destructor(conn, ctdbd_connection_destructor); -- 2.11.4.GIT