1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-15 05:57:49 +03:00

ctdb-tests: Switch fake_ctdbd to use ctdb_get_peer_pid()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 05a908d71c4b7484ba0243fa51bc05c79c8fb357)
This commit is contained in:
Martin Schwenke 2018-06-08 22:31:48 +10:00 committed by Karolin Seeger
parent 8af4bac8ec
commit 35128a93e7

View File

@ -40,6 +40,7 @@
#include "common/logging.h"
#include "common/tunable.h"
#include "common/srvid.h"
#include "common/system.h"
#include "ipalloc_read_known_ips.h"
@ -3050,8 +3051,6 @@ static struct tevent_req *client_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req;
struct client_state *state;
struct ucred cr;
socklen_t crl = sizeof(struct ucred);
int ret;
req = tevent_req_create(mem_ctx, &state, struct client_state);
@ -3064,12 +3063,7 @@ static struct tevent_req *client_send(TALLOC_CTX *mem_ctx,
state->ctdb = ctdb;
state->pnn = pnn;
ret = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl);
if (ret != 0) {
tevent_req_error(req, ret);
return tevent_req_post(req, ev);
}
state->pid = cr.pid;
(void) ctdb_get_peer_pid(fd, &state->pid);
ret = comm_setup(state, ev, fd, client_read_handler, req,
client_dead_handler, req, &state->comm);