Commit graph

7 commits

Author SHA1 Message Date
Yabin Cui
c1b1f6ff5d Add unit tests for local socket.
Add has_write_error flag in asocket, so it will not wait on local_socket_closing_list
to write pending packets in local_socket_close(). Although it doesn't fix any problem,
it helps to make the code more stable.
Add a missing put_apacket() in error handling.
Add a check when adding local socket in local_socket_closing_list.

Bug: 23314034

Change-Id: I75b07ba8ee59b7f277fba2fb919db63065b291be
2015-09-16 15:00:59 -07:00
Yabin Cui
bec02fc43d adb: add unit test for fdevent.
Change-Id: Ic26cda5d8e84425bc60ce36bc686bb6917c4ca3c
2015-08-28 21:33:22 -07:00
Elliott Hughes
2d4121c0dc Remove extern "C" barriers to using C++.
Change-Id: Ic046d6aa540738cb46b54531bc59ba3b47b0136d
2015-04-17 09:47:42 -07:00
Dan Albert
630b9afeb0 Begin moving code from adb to libadb.
Much of adb is duplicated in bootable/recovery/minadb and fastboot.
Changes made to adb rarely get ported to the other two, so the trees
have diverged a bit. We'd like to stop this because it is a
maintenance nightmare, but the divergence makes this difficult to do
all at once. For now, we will start small by moving common files into
a static library. Hopefully some day we can get enough of adb in here
that we no longer need minadb.

Bug: 17626262
Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
2015-01-26 16:45:34 -08:00
JP Abgrall
408fa57864 adb: fix subprocess exit handling, oom adjust fixes, extra debugging.
* Add support for correctly handling subprocess termination in shell service  (b/3400254 b/3482112 b/2249397)
 - have a waitpid() track the subprocess, then notify the fdevent via a socket
 - force an eof on the pty master in fdevent's new subproc handler.
 - modify fdevent to force-read the pty after an exit.
* Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it
 belongs.
* Fix the race around OOM adjusting.
  - Do it in the child before exec() instead of the in the parent as the
   child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
  - Allow locks across object files.
  - Add lock within D()
  - Make sure sysdesp init (mutex init also) is called early.
* Add some missing close(fd) calls
  - Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.
* Fix some errno handling and make D() correctly handle it.
* Add new adb trace_mask: services.
* Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely).
* Remove obsolete commandline args reported in help. (b/3509092)


Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
2011-03-28 14:12:22 -07:00
David 'Digit' Turner
f6330a2eeb Cleaning up whitespace in adb sources. Nothing more, nothing less. 2009-05-18 17:36:28 +02:00
David 'Digit' Turner
414ff7d98a Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon. 2009-05-18 17:07:46 +02:00
Renamed from include/cutils/fdevent.h (Browse further)