summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-02-10 12:51:25 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-10 12:51:25 +0000
commit54cf89a24b0e5cb5a3f0be4e5938e7ecd4ed44dd (patch)
tree7ecfc72d33a94613e570343a45c627e002481f2f /debuggerd
parent84a95225d66c11ffabe7e55145d220e98a38774f (diff)
parent00010369a6a4d9b3db58a22dfeca258f328147da (diff)
downloadsystem_core-54cf89a24b0e5cb5a3f0be4e5938e7ecd4ed44dd.zip
system_core-54cf89a24b0e5cb5a3f0be4e5938e7ecd4ed44dd.tar.gz
system_core-54cf89a24b0e5cb5a3f0be4e5938e7ecd4ed44dd.tar.bz2
am 00010369: am 3bff7e3e: am 136a9619: Merge "Use socklen_t instead of int in debuggerd."
* commit '00010369a6a4d9b3db58a22dfeca258f328147da': Use socklen_t instead of int in debuggerd.
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/debuggerd.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index c39aaf6..a2b164e 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -46,12 +46,12 @@
#include "tombstone.h"
#include "utility.h"
-typedef struct {
+struct debugger_request_t {
debugger_action_t action;
pid_t pid, tid;
uid_t uid, gid;
uintptr_t abort_msg_address;
-} debugger_request_t;
+};
static int write_string(const char* file, const char* string) {
int len;
@@ -116,7 +116,7 @@ static void wait_for_user_action(pid_t pid) {
dit,_,dit,_,dit,___,dah,_,dah,_,dah,___,dit,_,dit,_,dit,_______
};
size_t s = 0;
- struct input_event e;
+ input_event e;
bool done = false;
init_debug_led();
enable_debug_led();
@@ -176,8 +176,8 @@ static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* ou
}
static int read_request(int fd, debugger_request_t* out_request) {
- struct ucred cr;
- int len = sizeof(cr);
+ ucred cr;
+ socklen_t len = sizeof(cr);
int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
if (status != 0) {
LOG("cannot get credentials\n");
@@ -187,7 +187,7 @@ static int read_request(int fd, debugger_request_t* out_request) {
XLOG("reading tid\n");
fcntl(fd, F_SETFL, O_NONBLOCK);
- struct pollfd pollfds[1];
+ pollfd pollfds[1];
pollfds[0].fd = fd;
pollfds[0].events = POLLIN;
pollfds[0].revents = 0;
@@ -441,13 +441,11 @@ static int do_server() {
LOG("debuggerd: " __DATE__ " " __TIME__ "\n");
for (;;) {
- struct sockaddr addr;
- socklen_t alen;
- int fd;
+ sockaddr addr;
+ socklen_t alen = sizeof(addr);
- alen = sizeof(addr);
XLOG("waiting for connection\n");
- fd = accept(s, &addr, &alen);
+ int fd = accept(s, &addr, &alen);
if (fd < 0) {
XLOG("accept failed: %s\n", strerror(errno));
continue;