Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
ctdb-client: Print error message before next syscall to avoid losing …
Browse files Browse the repository at this point in the history
…errno

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Aug 17, 2016
1 parent 9401830 commit 1710b14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ctdb/client/ctdb_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,12 @@ int ctdb_socket_connect(struct ctdb_context *ctdb)
}

if (connect(ctdb->daemon.sd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
DEBUG(DEBUG_ERR,
(__location__
"Failed to connect client socket to daemon (%s)\n",
strerror(errno)));
close(ctdb->daemon.sd);
ctdb->daemon.sd = -1;
DEBUG(DEBUG_ERR,(__location__ " Failed to connect client socket to daemon. Errno:%s(%d)\n", strerror(errno), errno));
return -1;
}

Expand Down

0 comments on commit 1710b14

Please sign in to comment.