Commit graph

16185 commits

Author SHA1 Message Date
Yusuke Sato
adda8f7388 am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"
* commit '2f9e1db37416cdb580d870218b5fbfbed47a3758':
  Stop calling fsck on shutdown by default
2015-08-03 17:56:32 +00:00
Lee Campbell
2fb050b893 am 150c05fe: am 0f918878: Merge "init: Adding header guard to tokenizer"
* commit '150c05feeb482de2b4026fc35e392fc8c0ecd2df':
  init: Adding header guard to tokenizer
2015-08-01 15:48:39 +00:00
Elliott Hughes
564aa1e86d am 3d561748: am ec035950: Merge "Clean up -p handling slightly."
* commit '3d5617487c07f1fcbdf23755e0ca01559e3c5f3b':
  Clean up -p handling slightly.
2015-08-01 15:48:37 +00:00
Elliott Hughes
562fba9c64 am 6dca1987: am cf4dba5a: Merge "adb: win32: initial IPv6 support and improved Winsock error reporting"
* commit '6dca19875325a2ed25f9b55d736a9f6d17afeaad':
  adb: win32: initial IPv6 support and improved Winsock error reporting
2015-08-01 15:48:09 +00:00
Yabin Cui
709815cffe am a6fda917: am dc1fb361: Merge "Make clear of the data length sent by write_packet."
* commit 'a6fda917252ab9e47d89e181adbc22bccba1ca6c':
  Make clear of the data length sent by write_packet.
2015-08-01 15:47:50 +00:00
Yusuke Sato
2f9e1db374 am b5d6ad81: Merge "Stop calling fsck on shutdown by default"
* commit 'b5d6ad81cb963b6eceeb21c7f93bc433112c4b35':
  Stop calling fsck on shutdown by default
2015-07-31 23:20:48 +00:00
Yusuke Sato
b5d6ad81cb Merge "Stop calling fsck on shutdown by default" 2015-07-31 23:13:15 +00:00
Lee Campbell
150c05feeb am 0f918878: Merge "init: Adding header guard to tokenizer"
* commit '0f91887868e51de67bdf9aedc97fbcb044dc1969':
  init: Adding header guard to tokenizer
2015-07-31 21:52:47 +00:00
Lee Campbell
0f91887868 Merge "init: Adding header guard to tokenizer" 2015-07-31 21:47:13 +00:00
Elliott Hughes
3d5617487c am ec035950: Merge "Clean up -p handling slightly."
* commit 'ec035950e69badab883b5751c1059def2eea353d':
  Clean up -p handling slightly.
2015-07-31 21:09:03 +00:00
Elliott Hughes
ec035950e6 Merge "Clean up -p handling slightly." 2015-07-31 21:02:01 +00:00
Elliott Hughes
048b27c066 Clean up -p handling slightly.
Change-Id: I8a5cd4a7adb0dde9d09e0cbb620874b1bca35e43
2015-07-31 13:18:22 -07:00
Elliott Hughes
6dca198753 am cf4dba5a: Merge "adb: win32: initial IPv6 support and improved Winsock error reporting"
* commit 'cf4dba5ab315493531fff5a4867698a3659b0526':
  adb: win32: initial IPv6 support and improved Winsock error reporting
2015-07-31 18:18:32 +00:00
Elliott Hughes
cf4dba5ab3 Merge "adb: win32: initial IPv6 support and improved Winsock error reporting" 2015-07-31 18:11:45 +00:00
Yabin Cui
a6fda91725 am dc1fb361: Merge "Make clear of the data length sent by write_packet."
* commit 'dc1fb361f3aeee2cfb2791bd5fc42e4f2bc2dfb9':
  Make clear of the data length sent by write_packet.
2015-07-31 16:55:03 +00:00
Yabin Cui
dc1fb361f3 Merge "Make clear of the data length sent by write_packet." 2015-07-31 16:48:25 +00:00
Spencer Low
5200c6670f adb: win32: initial IPv6 support and improved Winsock error reporting
Call getaddrinfo() for connecting to IPv6 destinations.

Winsock APIs do not set errno. WSAGetLastError() returns Winsock errors
that are more numerous than BSD sockets, so it really doesn't make sense
to map those to BSD socket errors. Plus, even if we did that, the
Windows C Runtime (that mingw binaries use) has a strerror() that does
not recognize BSD socket error codes.

The solution is to wrap the various libcutils socket_* APIs with
sysdeps.h network_* APIs. For POSIX, the network_* APIs just call
strerror(). For Windows, they call SystemErrorCodeToString() (adapted
from Chromium).

Also in this change:

 - Various other code was modified to return errors in a std::string*
   argument, to be able to surface the error string to the end-user.

 - Improved error checking and use of D() to log Winsock errors for
   improved debuggability.

 - For sysdeps_win32.cpp, added unique_fh class that works like
   std::unique_ptr, for calling _fh_close().

 - Fix win32 adb_socketpair() setting of errno in error case.

 - Improve _socket_set_errno() D() logging to reduce confusion. Map
   a few extra error codes.

 - Move adb_shutdown() lower in sysdeps_win32.cpp so it can call
   _socket_set_errno().

 - Move network_connect() from adb_utils.cpp to sysdeps.h.

 - Merge socket_loopback_server() and socket_inaddr_any_server() into
   _network_server() since most of the code was identical.

Change-Id: I945f36870f320578b3a11ba093852ba6f7b93400
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-07-30 23:07:55 -07:00
Elliott Hughes
8f218426ff resolved conflicts for merge of 4e90b0ae to mnc-dr-dev-plus-aosp
Change-Id: Ib82bd1143c852905d40968896b5bcf41e0dab340
2015-07-30 20:09:15 -07:00
Yabin Cui
6264129434 Make clear of the data length sent by write_packet.
Change-Id: If51b4feaa19a710874999ad7e6131ff2e56a9f8a
2015-07-30 20:01:10 -07:00
Lee Campbell
06584400dd init: Adding header guard to tokenizer
Fixing missing header guard

BUG: 22843198
Change-Id: Ice5d29d343ffe093aae46d4ac3fd72de628fb12e
2015-07-30 18:48:50 -07:00
Elliott Hughes
4e90b0ae59 am 7b98bfcc: Merge "More adb cleanup."
* commit '7b98bfcc9fa8678d32a729a41036dea864f262ab':
  More adb cleanup.
2015-07-31 01:09:34 +00:00
Elliott Hughes
7b98bfcc9f Merge "More adb cleanup." 2015-07-31 01:01:20 +00:00
Elliott Hughes
5c74270f95 More adb cleanup.
This removes adb_dirstart and adb_dirstop. It also fixes a couple of memory
leaks by switching to std::string. This also fixes the bug in the previous
change --- mkdirs is given input like "/system/bin/sh" and only expected to
create "/system/bin". In a later change, we should remove mkdirs and only
expose the intended "unlink && mkdirs && create" functionality.

Change-Id: I30289dc1b3dff575cc1b158d993652178f587552
2015-07-30 17:46:58 -07:00
Elliott Hughes
d260be38c6 resolved conflicts for merge of 486645ee to mnc-dr-dev-plus-aosp
Change-Id: Ia7fbfc56f01b683e4e4870b3952fe2af32962123
2015-07-30 16:32:10 -07:00
Elliott Hughes
486645ee43 am 0cf93dc3: Merge "Write mkdirs in more idiomatic C++ style."
* commit '0cf93dc345cd5e8131009146a3b2767b1c60f77b':
  Write mkdirs in more idiomatic C++ style.
2015-07-30 23:00:45 +00:00
Elliott Hughes
0cf93dc345 Merge "Write mkdirs in more idiomatic C++ style." 2015-07-30 22:56:01 +00:00
Alex Vallée
47d67c96ec Write mkdirs in more idiomatic C++ style.
~ Rewrote mkdirs to be in C++ style.
~ Replaced adb_dir{start,stop} with std::string params and (r)find.
+ Added test for mkdirs.

Also make base/test_utils.h public and support temporary directories
as well as files.

Change-Id: I6fcbdc5e0099f3359d3aac6b00c436f250ca1329
2015-07-30 15:08:53 -07:00
Tom Cherry
7da270df1d am a21d8562: am d548e30f: Merge "init: Create classes for Action and Command"
* commit 'a21d85620560896bbed0cd43db9ed3224ab4e974':
  init: Create classes for Action and Command
2015-07-30 21:31:38 +00:00
Tom Cherry
a21d856205 am d548e30f: Merge "init: Create classes for Action and Command"
* commit 'd548e30f04b2eb7aa00deab42f5559d08396c38e':
  init: Create classes for Action and Command
2015-07-30 21:08:54 +00:00
Tom Cherry
d548e30f04 Merge "init: Create classes for Action and Command" 2015-07-30 21:03:48 +00:00
Andreas Gampe
9e12d94002 am 9773d945: am eb0b1513: Merge "Toolbox: Disable unused-const-variable warning"
* commit '9773d94571ed7c13a04ddb818a45820781d3bfdc':
  Toolbox: Disable unused-const-variable warning
2015-07-30 20:50:38 +00:00
Lee Campbell
45bd7bcf37 am 1691d968: am 138c540f: Merge "init: Add C++ tokenizer."
* commit '1691d968f8ae5f25036251fd5978be637bbf0b4a':
  init: Add C++ tokenizer.
2015-07-30 20:45:25 +00:00
Andreas Gampe
9773d94571 am eb0b1513: Merge "Toolbox: Disable unused-const-variable warning"
* commit 'eb0b151369371993a70c2079b8253f6dd24814b7':
  Toolbox: Disable unused-const-variable warning
2015-07-30 20:45:16 +00:00
Andreas Gampe
eb0b151369 Merge "Toolbox: Disable unused-const-variable warning" 2015-07-30 20:38:04 +00:00
Tom Cherry
fa0c21c94c init: Create classes for Action and Command
This creates the concept of 'event_trigger' vs 'property_trigger'

Previously these were merged into one, such that 'on property:a=b &&
property:b=c' is triggered when properties a=b and b=c as expected,
however combinations such as 'on early-boot && boot' would trigger
during both early-boot and boot.  Similarly, 'on early-boot &&
property:a=b' would trigger on both early-boot and again when property
a equals b.

The event trigger distinction ensures that the first example fails to
parse and the second example only triggers on early-boot if
property a equals b.

This coalesces Actions with the same triggers into a single Action object

Change-Id: I8f661d96e8a2d40236f252301bfe10979d663ea6
2015-07-30 13:37:23 -07:00
Lee Campbell
1691d968f8 am 138c540f: Merge "init: Add C++ tokenizer."
* commit '138c540f53249cdf3cbece7a54aca85202cf94e9':
  init: Add C++ tokenizer.
2015-07-30 20:36:46 +00:00
Lee Campbell
138c540f53 Merge "init: Add C++ tokenizer." 2015-07-30 20:30:07 +00:00
Dan Albert
629fe4a9ee am bec459a2: am 480bea33: Merge "Add top level sanitize options for ADB."
* commit 'bec459a277a0e391f5d36280bbf37eb6d84562fe':
  Add top level sanitize options for ADB.
2015-07-30 19:02:29 +00:00
Dan Albert
bec459a277 am 480bea33: Merge "Add top level sanitize options for ADB."
* commit '480bea3372e6b112c0ec80fdf82b16296d388d63':
  Add top level sanitize options for ADB.
2015-07-30 18:55:26 +00:00
Andreas Gampe
3294ad163f Toolbox: Disable unused-const-variable warning
For build-system CFLAGS clean-up, disable unused-const-variable
warning.

Bug: 18632512
Change-Id: I1be1ac744f8c77bd0a8378578072285a2c035245
2015-07-30 11:52:11 -07:00
Lee Campbell
220ca84223 init: Add C++ tokenizer.
Adds a C++ tokenizer along with unit tests.

This tokenizer will replace the current C implementation
which does a poor job of keeping track of pointers.

This CL is a prerequisite for up coming changes to
the parser. This CL does not wire up this tokenizer and
changes no exsiting code. All that builds is the unit tests.

Change-Id: Iec3740bce7153640adc5e5bbdc57e644cedf0038
TEST: Unit tests all pass. No leaks under valgrind
BUG: 22843198
2015-07-30 18:45:17 +00:00
Dan Albert
480bea3372 Merge "Add top level sanitize options for ADB." 2015-07-30 18:44:37 +00:00
Elliott Hughes
229014e384 am 7a699a6a: am 9bc4e7a5: Merge "bionic no longer sends SIGPIPE to debuggerd."
* commit '7a699a6ac63d9ed1e0b994c108189b219f1461bd':
  bionic no longer sends SIGPIPE to debuggerd.
2015-07-30 17:48:13 +00:00
Elliott Hughes
7a699a6ac6 am 9bc4e7a5: Merge "bionic no longer sends SIGPIPE to debuggerd."
* commit '9bc4e7a5530337e182a8876e14e71ee741dd67ac':
  bionic no longer sends SIGPIPE to debuggerd.
2015-07-30 17:42:56 +00:00
Elliott Hughes
9bc4e7a553 Merge "bionic no longer sends SIGPIPE to debuggerd." 2015-07-30 17:33:16 +00:00
Dan Albert
9113b47eac Add top level sanitize options for ADB.
Host and target are split here because the target can really only use
ubsan (most sanitizers don't support static executables).

Change-Id: I8a5a5adeeef5c27aaaa3d8145b1570760b764ce3
2015-07-30 10:25:32 -07:00
Dan Albert
5659918d6f am cc552ea3: am 3b5b1328: Merge "adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL"
* commit 'cc552ea335497ecd95db3eae136d10ab3026d171':
  adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL
2015-07-30 17:20:15 +00:00
Dan Albert
cc552ea335 am 3b5b1328: Merge "adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL"
* commit '3b5b1328173b4914ccc3c50bdd5eaa046dbd6cd7':
  adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL
2015-07-30 17:09:04 +00:00
Dan Albert
3b5b132817 Merge "adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL" 2015-07-30 17:04:52 +00:00
Elliott Hughes
5ec940aed8 am fb1ecbc5: am e6e71608: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
  Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:27 +00:00