Add daemon response code

This commit is contained in:
topjohnwu
2017-05-05 16:13:26 +08:00
parent d66c284bed
commit 58849f28a8
8 changed files with 59 additions and 28 deletions

View File

@@ -386,3 +386,9 @@ void clone_attr(const char *source, const char *target) {
lsetfilecon(target, con);
free(con);
}
void get_client_cred(int fd, struct ucred *cred) {
socklen_t ucred_length = sizeof(*cred);
if(getsockopt(fd, SOL_SOCKET, SO_PEERCRED, cred, &ucred_length))
PLOGE("getsockopt");
}

View File

@@ -89,5 +89,6 @@ int cp_afc(const char *source, const char *target);
int clone_dir(const char *source, const char *target);
int rm_rf(const char *target);
void clone_attr(const char *source, const char *target);
void get_client_cred(int fd, struct ucred *cred);
#endif