Merge "Add more logging message and dead code"

This commit is contained in:
Mark Salyzyn 2015-02-23 22:38:49 +00:00 committed by Gerrit Code Review
commit 263b6cb6e3
3 changed files with 9 additions and 20 deletions

View file

@ -529,17 +529,12 @@ remote_error:
} else { } else {
memcpy(buffer, &id, 4); memcpy(buffer, &id, 4);
buffer[4] = 0; buffer[4] = 0;
// strcpy(buffer,"unknown reason");
} }
fprintf(stderr,"failed to copy '%s' to '%s': %s\n", rpath, lpath, buffer); fprintf(stderr,"failed to copy '%s' to '%s': %s\n", rpath, lpath, buffer);
return 0; return 0;
} }
/* --- */ /* --- */
static void do_sync_ls_cb(unsigned mode, unsigned size, unsigned time, static void do_sync_ls_cb(unsigned mode, unsigned size, unsigned time,
const char *name, void *cookie) const char *name, void *cookie)
{ {
@ -573,7 +568,6 @@ struct copyinfo
unsigned int mode; unsigned int mode;
unsigned int size; unsigned int size;
int flag; int flag;
//char data[0];
}; };
copyinfo *mkcopyinfo(const char *spath, const char *dpath, copyinfo *mkcopyinfo(const char *spath, const char *dpath,
@ -601,7 +595,6 @@ copyinfo *mkcopyinfo(const char *spath, const char *dpath,
snprintf((char*) ci->src, ssize, isdir ? "%s%s/" : "%s%s", spath, name); snprintf((char*) ci->src, ssize, isdir ? "%s%s/" : "%s%s", spath, name);
snprintf((char*) ci->dst, dsize, isdir ? "%s%s/" : "%s%s", dpath, name); snprintf((char*) ci->dst, dsize, isdir ? "%s%s/" : "%s%s", dpath, name);
// fprintf(stderr,"mkcopyinfo('%s','%s')\n", ci->src, ci->dst);
return ci; return ci;
} }
@ -615,8 +608,6 @@ static int local_build_list(copyinfo **filelist,
copyinfo *dirlist = 0; copyinfo *dirlist = 0;
copyinfo *ci, *next; copyinfo *ci, *next;
// fprintf(stderr,"local_build_list('%s','%s')\n", lpath, rpath);
d = opendir(lpath); d = opendir(lpath);
if(d == 0) { if(d == 0) {
fprintf(stderr,"cannot open '%s': %s\n", lpath, strerror(errno)); fprintf(stderr,"cannot open '%s': %s\n", lpath, strerror(errno));

View file

@ -45,8 +45,6 @@ int sendfailmsg(int fd, const char *reason)
return writex(fd, reason, len); return writex(fd, reason, len);
} }
//extern int online;
static unsigned local_socket_next_id = 1; static unsigned local_socket_next_id = 1;
static asocket local_socket_list = { static asocket local_socket_list = {
@ -196,10 +194,9 @@ enqueue:
static void local_socket_ready(asocket *s) static void local_socket_ready(asocket *s)
{ {
/* far side is ready for data, pay attention to /* far side is ready for data, pay attention to
readable events */ readable events */
fdevent_add(&s->fde, FDE_READ); fdevent_add(&s->fde, FDE_READ);
// D("LS(%d): ready()\n", s->id);
} }
static void local_socket_close(asocket *s) static void local_socket_close(asocket *s)
@ -240,7 +237,7 @@ static void local_socket_destroy(asocket *s)
static void local_socket_close_locked(asocket *s) static void local_socket_close_locked(asocket *s)
{ {
D("entered. LS(%d) fd=%d\n", s->id, s->fd); D("entered local_socket_close_locked. LS(%d) fd=%d\n", s->id, s->fd);
if(s->peer) { if(s->peer) {
D("LS(%d): closing peer. peer->id=%d peer->fd=%d\n", D("LS(%d): closing peer. peer->id=%d peer->fd=%d\n",
s->id, s->peer->id, s->peer->fd); s->id, s->peer->id, s->peer->fd);
@ -403,7 +400,6 @@ static void local_socket_event_func(int fd, unsigned ev, void *_s)
** catching it here means we may skip the last few ** catching it here means we may skip the last few
** bytes of readable data. ** bytes of readable data.
*/ */
// s->close(s);
D("LS(%d): FDE_ERROR (fd=%d)\n", s->id, s->fd); D("LS(%d): FDE_ERROR (fd=%d)\n", s->id, s->fd);
return; return;
@ -422,8 +418,6 @@ asocket *create_local_socket(int fd)
install_local_socket(s); install_local_socket(s);
fdevent_install(&s->fde, fd, local_socket_event_func, s); fdevent_install(&s->fde, fd, local_socket_event_func, s);
/* fdevent_add(&s->fde, FDE_ERROR); */
//fprintf(stderr, "Created local socket in create_local_socket \n");
D("LS(%d): created (fd=%d)\n", s->id, s->fd); D("LS(%d): created (fd=%d)\n", s->id, s->fd);
return s; return s;
} }

View file

@ -379,6 +379,7 @@ static int usb_bulk_read(usb_handle *h, void *data, int len)
struct usbdevfs_urb *out = NULL; struct usbdevfs_urb *out = NULL;
int res; int res;
D("++ usb_bulk_read ++\n");
memset(urb, 0, sizeof(*urb)); memset(urb, 0, sizeof(*urb));
urb->type = USBDEVFS_URB_TYPE_BULK; urb->type = USBDEVFS_URB_TYPE_BULK;
urb->endpoint = h->ep_in; urb->endpoint = h->ep_in;
@ -441,6 +442,7 @@ static int usb_bulk_read(usb_handle *h, void *data, int len)
} }
fail: fail:
adb_mutex_unlock(&h->lock); adb_mutex_unlock(&h->lock);
D("-- usb_bulk_read --\n");
return res; return res;
} }
@ -451,6 +453,7 @@ int usb_write(usb_handle *h, const void *_data, int len)
int n; int n;
int need_zero = 0; int need_zero = 0;
D("++ usb_write ++\n");
if(h->zero_mask) { if(h->zero_mask) {
/* if we need 0-markers and our transfer /* if we need 0-markers and our transfer
** is an even multiple of the packet size, ** is an even multiple of the packet size,
@ -480,6 +483,7 @@ int usb_write(usb_handle *h, const void *_data, int len)
return n; return n;
} }
D("-- usb_write --\n");
return 0; return 0;
} }
@ -554,7 +558,7 @@ void usb_kick(usb_handle *h)
int usb_close(usb_handle *h) int usb_close(usb_handle *h)
{ {
D("[ usb close ... ]\n"); D("++ usb close ++\n");
adb_mutex_lock(&usb_lock); adb_mutex_lock(&usb_lock);
h->next->prev = h->prev; h->next->prev = h->prev;
h->prev->next = h->next; h->prev->next = h->next;
@ -562,7 +566,7 @@ int usb_close(usb_handle *h)
h->next = 0; h->next = 0;
adb_close(h->desc); adb_close(h->desc);
D("[ usb closed %p (fd = %d) ]\n", h, h->desc); D("-- usb closed %p (fd = %d) --\n", h, h->desc);
adb_mutex_unlock(&usb_lock); adb_mutex_unlock(&usb_lock);
free(h); free(h);