From 16527ceaf6aa3d90b39b67223f36310cb56da688 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 5 May 2017 16:13:00 +0800 Subject: [PATCH] Use util function --- su_client.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/su_client.c b/su_client.c index 05a22f98d..158d40687 100644 --- a/su_client.c +++ b/su_client.c @@ -104,9 +104,7 @@ void su_daemon_receiver(int client) { // Check the credentials struct ucred credentials; - socklen_t ucred_length = sizeof(struct ucred); - if(getsockopt(client, SOL_SOCKET, SO_PEERCRED, &credentials, &ucred_length)) - PLOGE("getsockopt"); + get_client_cred(client, &credentials); from_uid = credentials.uid; from_pid = credentials.pid;