Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
09392be0
Commit
09392be0
authored
Jul 08, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup file descriptors and add info
parent
60ca704a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
su.c
su.c
+2
-2
su_socket.c
su_socket.c
+2
-2
No files found.
su.c
View file @
09392be0
...
@@ -35,7 +35,7 @@ static void usage(int status) {
...
@@ -35,7 +35,7 @@ static void usage(int status) {
FILE
*
stream
=
(
status
==
EXIT_SUCCESS
)
?
stdout
:
stderr
;
FILE
*
stream
=
(
status
==
EXIT_SUCCESS
)
?
stdout
:
stderr
;
fprintf
(
stream
,
fprintf
(
stream
,
"MagiskSU v"
xstr
(
MAGISK_VERSION
)
"
\n\n
"
"MagiskSU v"
xstr
(
MAGISK_VERSION
)
"
("
xstr
(
MAGISK_VER_CODE
)
")
\n\n
"
"Usage: su [options] [--] [-] [LOGIN] [--] [args...]
\n\n
"
"Usage: su [options] [--] [-] [LOGIN] [--] [args...]
\n\n
"
"Options:
\n
"
"Options:
\n
"
" -c, --command COMMAND pass COMMAND to the invoked shell
\n
"
" -c, --command COMMAND pass COMMAND to the invoked shell
\n
"
...
@@ -50,7 +50,7 @@ static void usage(int status) {
...
@@ -50,7 +50,7 @@ static void usage(int status) {
" this is used almost exclusively by Superuser.apk
\n
"
" this is used almost exclusively by Superuser.apk
\n
"
" -mm, -M,
\n
"
" -mm, -M,
\n
"
" --mount-master run in the global mount namespace,
\n
"
" --mount-master run in the global mount namespace,
\n
"
" use if you need to publicly apply mounts"
);
" use if you need to publicly apply mounts
\n
"
);
exit2
(
status
);
exit2
(
status
);
}
}
...
...
su_socket.c
View file @
09392be0
...
@@ -22,7 +22,7 @@ int socket_create_temp(char *path, size_t len) {
...
@@ -22,7 +22,7 @@ int socket_create_temp(char *path, size_t len) {
int
fd
;
int
fd
;
struct
sockaddr_un
sun
;
struct
sockaddr_un
sun
;
fd
=
xsocket
(
AF_LOCAL
,
SOCK_STREAM
,
0
);
fd
=
xsocket
(
AF_LOCAL
,
SOCK_STREAM
|
SOCK_CLOEXEC
,
0
);
if
(
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
))
{
if
(
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
))
{
PLOGE
(
"fcntl FD_CLOEXEC"
);
PLOGE
(
"fcntl FD_CLOEXEC"
);
}
}
...
@@ -65,7 +65,7 @@ int socket_accept(int serv_fd) {
...
@@ -65,7 +65,7 @@ int socket_accept(int serv_fd) {
PLOGE
(
"select"
);
PLOGE
(
"select"
);
}
}
return
xaccept
(
serv_fd
,
NULL
,
NULL
);
return
xaccept
4
(
serv_fd
,
NULL
,
NULL
,
SOCK_CLOEXEC
);
}
}
#define write_data(fd, data, data_len) \
#define write_data(fd, data, data_len) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment