Use util function

This commit is contained in:
topjohnwu 2017-05-05 16:13:00 +08:00
parent f799db67eb
commit 16527ceaf6

View File

@ -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;