mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Remove unused code
This commit is contained in:
parent
726ffdcd98
commit
d364554425
@ -6,20 +6,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
static size_t socket_len(sockaddr_un *sun) {
|
||||
if (sun->sun_path[0])
|
||||
return sizeof(sa_family_t) + strlen(sun->sun_path) + 1;
|
||||
else
|
||||
return sizeof(sa_family_t) + strlen(sun->sun_path + 1) + 1;
|
||||
}
|
||||
|
||||
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name) {
|
||||
memset(sun, 0, sizeof(*sun));
|
||||
sun->sun_family = AF_UNIX;
|
||||
strcpy(sun->sun_path + 1, name);
|
||||
return socket_len(sun);
|
||||
}
|
||||
|
||||
bool get_client_cred(int fd, sock_cred *cred) {
|
||||
socklen_t len = sizeof(ucred);
|
||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, cred, &len) != 0)
|
||||
@ -142,10 +128,7 @@ int read_int(int fd) {
|
||||
}
|
||||
|
||||
int read_int_be(int fd) {
|
||||
uint32_t val;
|
||||
if (xxread(fd, &val, sizeof(val)) != sizeof(val))
|
||||
return -1;
|
||||
return ntohl(val);
|
||||
return ntohl(read_int(fd));
|
||||
}
|
||||
|
||||
void write_int(int fd, int val) {
|
||||
@ -154,8 +137,7 @@ void write_int(int fd, int val) {
|
||||
}
|
||||
|
||||
void write_int_be(int fd, int val) {
|
||||
uint32_t nl = htonl(val);
|
||||
xwrite(fd, &nl, sizeof(nl));
|
||||
write_int(fd, htonl(val));
|
||||
}
|
||||
|
||||
bool read_string(int fd, std::string &str) {
|
||||
|
@ -10,7 +10,6 @@ struct sock_cred : public ucred {
|
||||
std::string context;
|
||||
};
|
||||
|
||||
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name);
|
||||
bool get_client_cred(int fd, sock_cred *cred);
|
||||
std::vector<int> recv_fds(int sockfd);
|
||||
int recv_fd(int sockfd);
|
||||
|
Loading…
Reference in New Issue
Block a user