Commit graph

847 commits

Author SHA1 Message Date
Colin Cross
9993e799f1 Hide warning in cutils/trace.h
system/core/include is included in the global include path using
-isystem, which hides all warnings.  cutils/trace.h has an ignored
return value warning, move the implementation to trace-dev.c so it
doesn't cause warnings in every module that includes it in preparation
for moving from -isystem to -I.

Test: m -j native
Bug: 31492149
Change-Id: If8b3fe13059c9e59c2d5208294d427d84fa6e588
2016-09-21 17:45:31 -07:00
Connor O'Brien
a963ae87b9 Add basic tests for ashmem
Test: CL only adds tests. Ran them to confirm they pass.
Change-Id: Iccc3edaeeabff27f23b3786c3d40b2eb5b02dc83
Signed-off-by: Connor O'Brien <connoro@google.com>
2016-09-20 16:17:24 -07:00
Mitchell Wills
d44d3b526a Give wifi_hal_legacy access to netlink
Bug: 31352200
Change-Id: I02bbbbc2be028b482d5c3d3e903ed2c9addebd77
2016-09-13 15:46:35 -07:00
Christopher Wiley
6f8e12e6fc Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW
Bug: 30041118
Change-Id: I14d1fd601fc4bce12c563a2004e91bd8ba0f42c3
Test: hostapd can start as the wifi user with these capabilities.
(cherry picked from commit 2502490178)
(cherry picked from commit a76088362e)
2016-09-07 13:30:23 -07:00
Josh Gao
ccccbeca43 Merge "libcutils: try all addresses in socket_network_client_timeout." am: f3d43032d2 am: b7011e0410
am: 03da262702

Change-Id: I59153454f926ce0bcb68b2c5774f275cbc7db3bd
2016-09-02 00:59:06 +00:00
Josh Gao
b7011e0410 Merge "libcutils: try all addresses in socket_network_client_timeout."
am: f3d43032d2

Change-Id: I373ce6f43a7164754930c62c7fe249ed6530cfd0
2016-09-02 00:52:38 +00:00
Josh Gao
78cc20f007 libcutils: try all addresses in socket_network_client_timeout.
If a connection fails to an address that resolves to multiple
sockaddrs, attempt connecting to subsequent addresses if the initial
connection fails to a reason other than timeout. This is primarily
useful for localhost, which can resolve to both an IPv4 and and IPv6
address.

Also, add an adb test to verify that this behavior.

Bug: http://b/30313466
Change-Id: Ib2df706a66cf6ef8c1097fdfd7aedb69b8df2d6e
Test: python test_adb.py (+ the test fails before this patch)
2016-09-01 15:56:58 -07:00
John Reck
4409555732 Merge "Fix access check" am: 87ef739dba am: 9cbbe2d9df
am: cf2f39d7de

Change-Id: I37d1d5c616a6a68751a63e05fdf6c0199b0fd671
2016-08-30 01:31:17 +00:00
Mitchell Wills
e551125cfa Merge commit '5a33ad4d5210346a4a4c11af7ffbc82e0cffa53c' into manual_merge_5a33ad4
Change-Id: I873555a7284323e6ca839cf4982f9d07f49a5f4e
2016-08-29 18:13:09 -07:00
John Reck
9cbbe2d9df Merge "Fix access check"
am: 87ef739dba

Change-Id: Iee618c55186988f79e926a34cd7692f1d01a7f99
2016-08-29 22:28:56 +00:00
John Reck
2e336b1da1 Fix access check
Fixes a bug where USE_CPUSET used access(F_OK)
as a sign that it should try writing to the cpuset
path. It needs to instead use access(W_OK) to
ensure that it has write access as that's what
it would try to open() with.

And stop trying to repeatedly open a file that
doesn't exist.

Change-Id: Ib391ee6f08345051c48a986a732eda30143cb614
2016-08-26 14:05:03 -07:00
Christopher Wiley
a76088362e Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW
Bug: 30041118
Change-Id: I14d1fd601fc4bce12c563a2004e91bd8ba0f42c3
Test: hostapd can start as the wifi user with these capabilities.
(cherry picked from commit 2502490178)
2016-08-26 13:13:39 -07:00
Mark Salyzyn
8e5cb037c4 Merge "libcutils: Add ashmem_valid() function" am: d00c7470ea am: 8b1f7b595c
am: da07f7880c

Change-Id: I3a4cf9a2cd848aae04ec3e88ae1e50a51774cd5f
2016-08-24 15:54:08 +00:00
Mark Salyzyn
8b1f7b595c Merge "libcutils: Add ashmem_valid() function"
am: d00c7470ea

Change-Id: Ib09d3ee7bb131c30f59ea273f357c045394206fb
2016-08-24 15:48:55 +00:00
Mark Salyzyn
ee431112ff libcutils: Add ashmem_valid() function
Bug: 30310689
Change-Id: I14c52c5d52745a725799652b87c86281ac214899
2016-08-23 15:29:28 -07:00
Dmitriy Filchenko
ceca7afbc7 Merge "Remove process_name.c" am: e5b7ad1c39 am: 97e3cb7074
am: de9e6fb4b0

Change-Id: I402ab55567532786d61412e7c567e2da5fbc800b
2016-08-19 01:36:31 +00:00
Dmitriy Filchenko
97e3cb7074 Merge "Remove process_name.c"
am: e5b7ad1c39

Change-Id: I8f98f5fe9ff526ed8780971eddef128ed46de271
2016-08-19 01:30:34 +00:00
Dmitriy Filchenko
1bb49f483b Remove process_name.c
BUG: 29824203

Change-Id: I88d67cafb8ec0c4eea3db047bac0671de698ba02
2016-08-18 23:54:46 +00:00
Greg Hackmann
7b6aacbe4b Merge "libcutils: add sched_policy test" am: 5f851752d3 am: 9d963a2b20
am: ac8e16d6c6

Change-Id: I5f71544ae5662cbbd4fb621def74e522af6d9480
2016-08-04 16:37:05 +00:00
Greg Hackmann
9d963a2b20 Merge "libcutils: add sched_policy test"
am: 5f851752d3

Change-Id: If3f9f573303b0485582d7090afb6ecbbdca73a4f
2016-08-04 16:32:00 +00:00
Treehugger Robot
5f851752d3 Merge "libcutils: add sched_policy test" 2016-08-04 16:24:30 +00:00
Elliott Hughes
c4f153e97b Merge "Remove the prctl PR_SET_TIMERSLACK_PID call." am: b3654fa086 am: fb7e8a0088
am: a9638e7ff6

Change-Id: I170c97da6dd147d37bb8750bc4c750bf676d611d
2016-08-04 02:36:15 +00:00
Elliott Hughes
fb7e8a0088 Merge "Remove the prctl PR_SET_TIMERSLACK_PID call."
am: b3654fa086

Change-Id: I5f833a1497fcbb8b7c3f1efcd707b6186a6409e6
2016-08-04 02:31:12 +00:00
Greg Hackmann
ed0614c80b libcutils: add sched_policy test
Bug: 30597190

Change-Id: I51950e82235fa19bc92b3f7e8d190766d71af7df
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-08-03 23:31:50 +00:00
Elliott Hughes
d7967c1347 Remove the prctl PR_SET_TIMERSLACK_PID call.
This is broken on all devices other than N9, and has no real path to fixing
it because there are so many different values already in use (41, 43, 47,
127), with no way to tell which you should use on any given device.

Bug: http://b/30597190
Change-Id: I07eeaaf6f5dc03c5532ffbfbb85ef2ad750206a0
2016-08-03 15:11:01 -07:00
John Stultz
5758078f5e Merge \\\"sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID\\\" am: 817d53493a am: acf5e849b4
am: 304c1264d4

Change-Id: I6055ee00f85e84d1748745415170acfdd0d690ec
2016-07-30 05:29:06 +00:00
John Stultz
acf5e849b4 Merge \"sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID\"
am: 817d53493a

Change-Id: Iea895b632b3bfa7daae0be34c2cc69563a18a6d5
2016-07-30 05:20:34 +00:00
John Stultz
2f13f0a48a sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID
The PR_SET_TIMERSLACK_PID number has collided with upstream
changes a number of times, and thus the number is not consistent
between AOSP common kernel versions.

In 4.6+, the upstream kernel added equivalent functionaity via
the /proc/<tid>/timerslack_ns entry.

This patch changes the sched_policy logic to support
/proc/<tid>/timerslack_ns if its available, falling back to the
older PR_SET_TIMERSLACK_PID method if not.

NOTE: Eventually PR_SET_TIMERSLACK_PID usage will need to be
removed as it is likely to conflict with valid future upstream
PR_* entries.

Also add missing O_CLOEXEC to other open calls in this file.

Change-Id: Iec0b8a62de0dc8bdd57b60df82bd4d31c5d64709
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-07-29 14:30:20 -07:00
Elliott Hughes
a9f814239b Merge \\\"Fix early init logging.\\\" am: 6d232ab4de am: 1cbd1f5016
am: 7e336c8fe5

Change-Id: Id22974510c241cc8b62c3737de36c1e5941420e3
2016-07-27 15:36:13 +00:00
Elliott Hughes
1cbd1f5016 Merge \"Fix early init logging.\"
am: 6d232ab4de

Change-Id: I437dd3b5243ca7854439c438093e94733579279e
2016-07-27 15:30:45 +00:00
Elliott Hughes
35f5d04620 Fix early init logging.
Remove the /dev/__kmsg__ workarounds (which can then be removed
from sepolicy), and fix confusion in the translation between
android-base logging and kernel logging priorities (in particular,
where 'notice' comes in the hierarchy).

Bug: http://b/30317429
Change-Id: I6eaf9919904b6b55bc402c20bf1a4ae269014bc7
Test: adb shell dmesg | grep init
2016-07-26 09:32:33 -07:00
Fyodor Kupolov
896595280d Fix permissions for /data/preloads
am: 13639b46d0

Change-Id: I48bca73b704ccee49f31a805f8c5e974b18810e5
2016-07-22 04:10:03 +00:00
Fyodor Kupolov
13639b46d0 Fix permissions for /data/preloads
Default permission bits are 771. It causes permission denied errors when
MediaProvider tries to scan /data/preloads. We have to allow read for others.

Bug: 29940807
Change-Id: I45645cf1154501ccb64bef08b9ad7bf7709dfd8e
2016-07-20 17:25:12 -07:00
Christopher Ferris
95043fb374 Merge \\\"Add ioprio values directly.\\\" am: feabb0fdc1 am: 93e00be7cc
am: 2e6ded2615

Change-Id: I63be2daefedb42f79fa04db65b63bddedda3fd25
2016-07-20 18:27:13 +00:00
Christopher Ferris
93e00be7cc Merge \"Add ioprio values directly.\"
am: feabb0fdc1

Change-Id: Ic8f7f714c30ef70172ebce8b6de7af8d09572eba
2016-07-20 18:10:55 +00:00
Christopher Ferris
feabb0fdc1 Merge "Add ioprio values directly." 2016-07-20 18:03:48 +00:00
Elliott Hughes
f58dc88f56 Merge \\\"Remove no-op klog_init.\\\" am: 5558cd362b am: 8932be864d
am: 30fc292a26

Change-Id: Ie40c73c1593e06392d042eb855b8bcb678d59b30
2016-07-19 19:54:04 +00:00
Elliott Hughes
8932be864d Merge \"Remove no-op klog_init.\"
am: 5558cd362b

Change-Id: I3f2112bead6740f1df48bc5b028f62c91d40425b
2016-07-19 19:48:36 +00:00
Elliott Hughes
489e3fbaa0 Remove no-op klog_init.
Change-Id: I467edad1d004ac16647f4aa1f0eead04e808efa0
2016-07-19 11:45:36 -07:00
Christopher Ferris
84421d8475 Add ioprio values directly.
The ioprio.h header is not a uapi header, so remove it's use and
add the two values that this code needs to use.

Bug: 30072483
Change-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020
2016-07-18 17:01:05 -07:00
Dan Willemsen
a13851876c Merge \\\"libcutils: Switch to Android.bp\\\" am: bc6c52f905 am: 4e8bb3e677
am: c7b34dc4a5

Change-Id: If407e29771d1af07715391befb066eb90e394086
2016-07-13 00:48:29 +00:00
Dan Willemsen
4e8bb3e677 Merge \"libcutils: Switch to Android.bp\"
am: bc6c52f905

Change-Id: Ie2beefe7f9992740ada57d6ab989abb74d257c5b
2016-07-13 00:41:15 +00:00
Dan Willemsen
eee8e7face libcutils: Switch to Android.bp
Change-Id: If36cb30e8e4432f1a5c7f9a6d30a75c012a4c67c
2016-07-12 16:37:08 -07:00
Tim Murray
b386d72266 Merge \"Add support for background stune group.\" into nyc-mr1-dev
am: 531bdd5a2c

Change-Id: Ia3be10db68dffc44e2d70535544c7c59d0933f7d
2016-07-11 23:55:17 +00:00
Tim Murray
5dcff8f2b1 Add support for background stune group.
bug 29512132

Change-Id: If8144bfee0fb30cf11f2bb26494ca5e83c11d4d7
2016-07-11 13:57:31 -07:00
Tim Murray
b8a19f4499 Merge changes from topic \'stune\' into nyc-mr1-dev
am: 4b75a86858

Change-Id: Ib11061d5d539f2e82ad16f122ea7d7b621bd988d
2016-07-11 20:35:56 +00:00
Tim Murray
955694b657 Add support for top-app stune group.
bug 29512132

Change-Id: I41ec2dd80a469309f48dbb59fc27fbe43fcd67b3
2016-07-11 11:40:15 -07:00
Tim Murray
aa45cb85e3 Set stune groups from set_sched_policy.
bug 29512132

Change-Id: Ib4176b80787db9e7ace9468cbf670f05cc428786
2016-07-11 10:05:56 -07:00
Elliott Hughes
6605b0b23a Merge \\\"Make klog_fd thread-safe and make klog_init a no-op.\\\" am: 588b770063 am: 73d363bbc1
am: 7288ac3982

Change-Id: I46bbcb64eecc01ec7bd8bb502237c1b9057befc4
2016-07-08 17:12:48 +00:00
Elliott Hughes
73d363bbc1 Merge \"Make klog_fd thread-safe and make klog_init a no-op.\"
am: 588b770063

Change-Id: I884276a8f8b8209f6e956c5fb410e8265184e1b5
2016-07-08 17:05:25 +00:00
Elliott Hughes
588b770063 Merge "Make klog_fd thread-safe and make klog_init a no-op." 2016-07-08 17:01:13 +00:00
Tim Murray
6469fa2a7e resolve merge conflicts of 3a29e34 to nyc-mr1-dev-plus-aosp
Change-Id: I4edd53094a98fcb3cd3e1b063122d13f80d36d3c
2016-07-07 13:40:18 -07:00
Tim Murray
3a29e344b0 Update FIFO settings for new uses of FIFO.
Adjust FIFO timings as well as allow SurfaceFlinger to use FIFO.

bug 24503801

Change-Id: I2c21d4c1788777c2d0d77227bb872701b35c4ff6
2016-07-07 11:35:41 -07:00
Mark Salyzyn
8e958c7aae Merge \\\"libcutils: canned_fs_config.c drop tabs\\\" am: 4ee9ed5366 am: ec129fe06c
am: a8dbadd54e

Change-Id: If505b2655e6dbdf863f227ad03838aca66ebd1f6
2016-07-06 18:59:04 +00:00
Mark Salyzyn
ec129fe06c Merge \"libcutils: canned_fs_config.c drop tabs\"
am: 4ee9ed5366

Change-Id: Ie72d7562be3316d2ebe732dd1d1fbd4a04b6557b
2016-07-06 18:54:23 +00:00
Mark Salyzyn
768cbb0404 libcutils: canned_fs_config.c drop tabs
- replace tabs with spaces, get indent right
- Sort header order as per Android coding standard

Change-Id: I634f6f716a368ce5565ccc880c51406042f312bf
2016-07-06 10:45:11 -07:00
Srinath Sridharan
ee85737277 Merge \"Not dynamically add system-background tasks to bg_schedboost_fd.\" into nyc-mr1-dev
am: 08d097adb4

Change-Id: I54a0332ad0bb61c3db5dbc5fc8a5be2558f356d6
2016-06-30 22:55:43 +00:00
Srinath Sridharan
70a415f8b8 Not dynamically add system-background tasks to bg_schedboost_fd.
System-background tasks can be either in bg_schedboost_fd or fg_schedboost_fd.
It is better to set the right cgroup via init.rc and not dynamically in
set_cpuset_policy.

BUG: 29533997
BUG: 29512132
Change-Id: If5dab78eafbe2d0d03fd7fd3f36d794cb4a7645f
2016-06-30 14:38:07 -07:00
Elliott Hughes
171a829c39 Make klog_fd thread-safe and make klog_init a no-op.
I'll come back and remove klog_init when I've removed other calls to it.

Change-Id: Iad7fd26d853b4ddc54e9abd44516b6f138cbbfcb
Test: booted N9, looked at "adb shell dmesg" output.
2016-06-29 16:16:41 -07:00
Elliott Hughes
6e1ef6432a resolve merge conflicts of cee6305 to nyc-mr1-dev-plus-aosp
Change-Id: Ia81286d9631a6d1206195bd477b3cc577f543cc3
2016-06-28 17:52:57 -07:00
Elliott Hughes
7191a56e96 Merge \"Remove unnecessary ARRAY_SIZE macros.\"
am: c37d8ea22a

Change-Id: Id3443d7247e893ee549ae5b799a8f0bf42088d35
2016-06-29 00:16:44 +00:00
Elliott Hughes
749ae2d32f Remove unnecessary ARRAY_SIZE macros.
Use the canonical one instead.

Change-Id: Id80f19455f37fd2a29d9ec4191c1a0af80c5c0e7
2016-06-28 14:48:45 -07:00
Josh Gao
fd94eae2e4 Merge changes from topic \\\'debuggerd_client\\\' am: abf88685e3 am: 88347e1430
am: 48915ad5e0

Change-Id: I48668c7a5c36b8786b919eb19c30fdcb2b3e417c
2016-06-20 20:52:41 +00:00
Josh Gao
88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Josh Gao
9c02dc5916 debuggerd: add libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-06-17 13:11:29 -07:00
Calin Juravle
483da3be85 Merge "Add utility to prepare files in a similar way to directories" into nyc-dev am: 6a29fe931d
am: 65d7c4722c

* commit '65d7c4722c7cfe5d8bd98bbd3f38bca97901a06a':
  Add utility to prepare files in a similar way to directories

Change-Id: Ibb9a117e02605f1164d220e58fc84b143e55b9c2
2016-06-02 10:33:42 +00:00
Calin Juravle
65d7c4722c Merge "Add utility to prepare files in a similar way to directories" into nyc-dev
am: 6a29fe931d

* commit '6a29fe931d9fd3bf7f2aad3713dc70c080970763':
  Add utility to prepare files in a similar way to directories

Change-Id: I288024d55e8cead1c902950938b03bfa8dcc3df3
2016-06-02 10:24:54 +00:00
Calin Juravle
3a8434bf73 Merge "Add utility to prepare files in a similar way to directories" into nyc-dev
am: 6a29fe931d

* commit '6a29fe931d9fd3bf7f2aad3713dc70c080970763':
  Add utility to prepare files in a similar way to directories

Change-Id: I7516ecd90c2ba9025e58af184e83b61b5cad9341
2016-06-02 10:24:40 +00:00
Calin Juravle
6a29fe931d Merge "Add utility to prepare files in a similar way to directories" into nyc-dev 2016-06-02 10:10:37 +00:00
Erik Kline
9bff938588 Merge "Add /vendor/xbin to the list of directories of executables" into nyc-dev am: 088f0e7c40
am: b927c6c39d

* commit 'b927c6c39d5f43b0bd68c3f85f5bf3786f081378':
  Add /vendor/xbin to the list of directories of executables

Change-Id: I491fd8ec7cfa611ee63ac51c657d70636ed392c2
2016-05-30 02:41:03 +00:00
Erik Kline
deb4e6e596 Merge "Add /vendor/xbin to the list of directories of executables" into nyc-dev
am: 088f0e7c40

* commit '088f0e7c40a1cc66505f2bd73c54f3bab9908986':
  Add /vendor/xbin to the list of directories of executables

Change-Id: Ib1172d5a5f0f0f1a82ce5ca260ef4539761ef679
2016-05-30 02:36:42 +00:00
Erik Kline
b927c6c39d Merge "Add /vendor/xbin to the list of directories of executables" into nyc-dev
am: 088f0e7c40

* commit '088f0e7c40a1cc66505f2bd73c54f3bab9908986':
  Add /vendor/xbin to the list of directories of executables

Change-Id: Ia48ba1bdab767ddd146aeb090c2c1a9bbc304e3d
2016-05-30 02:36:41 +00:00
Stephen Hines
496e073864 resolve merge conflicts of 5fb629a to nyc-mr1-dev-plus-aosp
Change-Id: I6424b08182637e7885b57119bc5eb6d5e3708c45
2016-05-27 17:01:44 -07:00
Chih-Hung Hsieh
5fb629a212 resolve merge conflicts of e845c04 to nyc-dev-plus-aosp
Change-Id: I423f722dcc3821b9be52613d68640b49cbac70a6
2016-05-27 16:04:21 -07:00
Erik Kline
a5a9c74f20 Add /vendor/xbin to the list of directories of executables
Bug: 28850734
Change-Id: Iaa14a463294d1f8a9c69328a273ce7f12a558bab
2016-05-27 17:37:53 +09:00
Calin Juravle
9812105b20 Add utility to prepare files in a similar way to directories
Bug: 28785119
Bug: 28625993
Change-Id: I505eb4deca0a89f64fe4505dd6729fe6a48bc1aa
2016-05-24 18:19:12 +01:00
Srinath Sridharan
e7b8d06f18 Merge "Only apply schedTune boost to top-app tasks" into nyc-mr1-dev
am: 87a4f046f0

* commit '87a4f046f01ff49d69e4ff2446266c29557fb5e1':
  Only apply schedTune boost to top-app tasks

Change-Id: I32ec1f0811971a527234672cadeeddcb50fd1369
2016-05-24 00:14:03 +00:00
Srinath Sridharan
1339871138 Only apply schedTune boost to top-app tasks
When using EAS, the foreground tasks were all getting boosted
during touchboosts. Limit it to top-app tasks.


BUG: 28378389
Change-Id: I72b7158a614bfd9b6c61024774e408ceba61fc9c
2016-05-23 23:59:38 +00:00
Chih-Hung Hsieh
c713bce901 Fix misc-macro-parentheses warnings in init and other core modules.
Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
2016-05-18 18:11:49 -07:00
Elliott Hughes
cb4abee6ca Merge "Don\'t expose ashmem constants on the host." am: 54fed512b9
am: ed95190b69

* commit 'ed95190b690adf3a452001fc527881af913c5ccd':
  Don't expose ashmem constants on the host.

Change-Id: I930dd0b72e88647b1e94694e5fb183431c7d75c6
2016-05-16 17:34:13 +00:00
Elliott Hughes
427c605b2a Don't expose ashmem constants on the host.
Change-Id: I86bf58841645114e382300228be7be69a555e76b
2016-05-13 14:47:30 -07:00
Mohamad Ayyash
8374276bfa Move canned_fs_config into libcutils
It's no longer specific to make_ext4fs, will be used for mksquashfs as
well.

BUG: 27467028
Change-Id: I41b8c2b168ada45c8378dee522391edfb8f6b9a6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
BUG: 28704419
2016-05-12 18:44:13 -07:00
Elliott Hughes
bc72a54073 Merge "<cutils/atomic.h> has been inlined for two years now." am: c5016de66b
am: 23e1312720

* commit '23e1312720c45944646f68379c1f15fcd8434da8':
  <cutils/atomic.h> has been inlined for two years now.

Change-Id: Ia4205030c07494149b8392abf74ec29ebd463724
2016-05-10 16:03:51 +00:00
Elliott Hughes
103e8f5608 <cutils/atomic.h> has been inlined for two years now.
Change-Id: If4f817acc054d7336df09a5b8dde34693e0e96a5
2016-05-09 15:11:56 -07:00
sergeyv
4a5736c08a Merge "atrace: read package names from multiple sysprops" into nyc-dev
am: d7dfadbd4c

* commit 'd7dfadbd4c66a8b6f1f8e0be805c211b83e88c16':
  atrace: read package names from multiple sysprops

Change-Id: I518cf650728c0d15a618ec8e40b26b2fe0385972
2016-04-30 00:07:44 +00:00
sergeyv
c19588cfc8 atrace: read package names from multiple sysprops
bug: 28200530
Change-Id: I4597a84f4fb16098b0e57684cde5e57c1f41eed5
2016-04-29 10:56:41 -07:00
Elliott Hughes
2af9f2fe82 Merge "More secure and compiler warning fix for sprintf into snprintf" am: 4f21555
am: e05688a

* commit 'e05688a176c27025d59c0a512501a411b56f1bb1':
  More secure and compiler warning fix for sprintf into snprintf

Change-Id: I93d4ff6d1c2674113d481ff06170d19f31951346
2016-04-19 22:23:33 +00:00
Raja M
a2f37e4fd7 More secure and compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building.
or
To support error free -D_FORTIFY_SOURCE=2 strict mode compilation.

Change-Id: I999bd83785456a77247e5e1d708e2bdde2eb057b
2016-04-20 02:20:50 +05:30
Martijn Coenen
f063033a91 Merge "Update get_sched_policy to return TOP_APP correctly." into nyc-dev
am: 15fea7a

* commit '15fea7ae1a4a179bb2c2e4066bfbfb312eec56e0':
  Update get_sched_policy to return TOP_APP correctly.

Change-Id: I7406fcf2fdcb2a34ee3a81bf9f74dceddc22d316
2016-04-11 10:39:17 +00:00
Martijn Coenen
15fea7ae1a Merge "Update get_sched_policy to return TOP_APP correctly." into nyc-dev 2016-04-11 10:31:26 +00:00
Mohamad Ayyash
fa7c7dd87d Merge "Move canned_fs_config into libcutils" into nyc-dev
am: 3f28318

* commit '3f2831876107ad18422bd67a459e2070c66a3827':
  Move canned_fs_config into libcutils

Change-Id: I88019bfa08603b1df2f2cbe4c79e45f126d83a1b
2016-04-08 17:55:59 +00:00
Mohamad Ayyash
8c788588f4 Move canned_fs_config into libcutils
It's no longer specific to make_ext4fs, will be used for mksquashfs as
well.

BUG: 27467028
Change-Id: I41b8c2b168ada45c8378dee522391edfb8f6b9a6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-04-07 22:44:00 -07:00
Martijn Coenen
7b173a148b Update get_sched_policy to return TOP_APP correctly.
Currently get_sched_policy() would only return foreground
or background, but not TOP_APP, since it's not looking
at CPUsets at all.

Fixing this makes testing easier, and it also corrects
the output of "ps -P" to show "ta" for current top app.

Bug: 27857142
Change-Id: I589cacc107f355de15750f01b06f404b59a0f99b
2016-04-04 17:11:56 +02:00
Joe Onorato
f0fa9f3608 Merge "Turn off duplicate log" into nyc-dev
am: e0e941e

* commit 'e0e941e34931990e230994fcb5a89ec41f6d5715':
  Turn off duplicate log
2016-03-24 23:34:07 +00:00
Joe Onorato
b03b6ac61e Turn off duplicate log
Bug: 27744135
Change-Id: Iaf5787d36c983f19586e1d1a40f35091fb168cfe
2016-03-24 11:33:15 -07:00
James Hawkins
650ba8b8d6 Merge "system/core/lib[c]utils: Fix signedness comparison warnings." am: bba2151b29
am: 65df16b05f

* commit '65df16b05f8d590e1fccc19e9a28833d6a71567d':
  system/core/lib[c]utils: Fix signedness comparison warnings.
2016-03-01 20:32:09 +00:00
James Hawkins
65df16b05f Merge "system/core/lib[c]utils: Fix signedness comparison warnings."
am: bba2151b29

* commit 'bba2151b29eb585b572eafc735917d7d74a2c0ad':
  system/core/lib[c]utils: Fix signedness comparison warnings.
2016-03-01 20:28:13 +00:00
James Hawkins
b898075f30 system/core/lib[c]utils: Fix signedness comparison warnings.
* Store the output of a length variable in size_t.
* Annotate unsigned constant values as such.

Bug: 27384813
Change-Id: I8504c0a8f5840d4d42e5c0df797a4e5d02d13eb9
2016-03-01 11:21:53 -08:00
Todd Kjos
973f224d31 Merge "Mount schedTune cgroup as /dev/stune" into nyc-dev
am: d125f6e8a9

* commit 'd125f6e8a95a998d74175df49d54251489723933':
  Mount schedTune cgroup as /dev/stune
2016-02-26 17:43:47 +00:00
Todd Kjos
d125f6e8a9 Merge "Mount schedTune cgroup as /dev/stune" into nyc-dev 2016-02-26 17:35:50 +00:00
Tim Murray
46f8276968 Fix build break with uninitialized boost_fd.
am: b43225eefb

* commit 'b43225eefb0e60858755d72103f9f9b53785b5d9':
  Fix build break with uninitialized boost_fd.
2016-02-25 23:56:25 +00:00
Tim Murray
b43225eefb Fix build break with uninitialized boost_fd.
Change-Id: Icf209e2e0f4835db01f61dbf83b4715db9ef03a9
(cherry picked from commit def6c151f4)
2016-02-25 23:53:08 +00:00
Christopher Ferris
82d84897b1 Fix incorrect handling of snprintf return value.
The code assumed that snprintf would never return a value less than
the passed in size of the buffer. This is not accurate, so fix all
of the places this assumptions is made. Also, if the name is too large,
then truncate just the name to make everything fit.

Added a new set of tests for this code. Verified that the old code passes
on the _normal and _exact version of the tests, but fails with the
FORTIFY error on the _truncated version of the tests. All tests pass
on the new code.

Bug: 27324359

(cherry picked from commit 626efb78a6)

Change-Id: Iba60a926cf5a1d6b517a6bfd8c797d724f093010
2016-02-25 14:02:00 -08:00
Christopher Ferris
126485e6c1 Merge "Fix incorrect handling of snprintf return value." am: 63f7a67c6e
am: 19f704ba66

* commit '19f704ba66ac1880ed5e26d80a1abe3922b5a4dc':
  Fix incorrect handling of snprintf return value.
2016-02-25 22:01:42 +00:00
Christopher Ferris
19f704ba66 Merge "Fix incorrect handling of snprintf return value."
am: 63f7a67c6e

* commit '63f7a67c6e39109b402aae9b121c117b8bb7bd7b':
  Fix incorrect handling of snprintf return value.
2016-02-25 21:59:38 +00:00
Christopher Ferris
626efb78a6 Fix incorrect handling of snprintf return value.
The code assumed that snprintf would never return a value less than
the passed in size of the buffer. This is not accurate, so fix all
of the places this assumptions is made. Also, if the name is too large,
then truncate just the name to make everything fit.

Added a new set of tests for this code. Verified that the old code passes
on the _normal and _exact version of the tests, but fails with the
FORTIFY error on the _truncated version of the tests. All tests pass
on the new code.

Bug: 27324359
Change-Id: I1b64ddde6f5ff2ec7f6428b998d21d41a1236b14
2016-02-25 12:46:44 -08:00
Lorenzo Colitti
5e953a2909 Merge "Delete dhcpcd code in system/core, since dhcpcd is no more." into nyc-dev
am: b046e74bef

* commit 'b046e74beff221d96189c4142f42f18730565921':
  Delete dhcpcd code in system/core, since dhcpcd is no more.
2016-02-25 07:57:34 +00:00
Lorenzo Colitti
9c07eb9dd8 Delete dhcpcd code in system/core, since dhcpcd is no more.
Bug: 27192644
Change-Id: I44c2ded2da69395f12a8850b2677322b11c2cb91
2016-02-25 16:04:43 +09:00
Elliott Hughes
ef2eba04e6 Merge "Clean up CLOEXEC in qtaguid." am: 72d6269b6e
am: 2d0899a3b4

* commit '2d0899a3b459a70a387be2983813b452af39e44e':
  Clean up CLOEXEC in qtaguid.
2016-02-23 18:51:36 +00:00
Elliott Hughes
2d0899a3b4 Merge "Clean up CLOEXEC in qtaguid."
am: 72d6269b6e

* commit '72d6269b6efda3e43a119de048b87758ff970184':
  Clean up CLOEXEC in qtaguid.
2016-02-23 18:46:44 +00:00
Todd Kjos
11cde567a8 Mount schedTune cgroup as /dev/stune
Make stune consistent with the other cgroups mounted under /dev

Change-Id: I0fe7120ad2afbe8e6a3c9f72cc3f465de618d344
2016-02-23 09:08:54 -08:00
Calin Juravle
b219fe37c6 Merge "Create profiles folders" into nyc-dev
am: aed972dead

* commit 'aed972dead82d2a74c3a9be296ba3390477d30cf':
  Create profiles folders
2016-02-22 11:49:17 +00:00
Elliott Hughes
b4de99c6dd Clean up CLOEXEC in qtaguid.
Change-Id: Ie14579b6c42340789b8b99009acc136dc4d1be4a
2016-02-19 18:13:51 -08:00
Calin Juravle
807f23aff2 Create profiles folders
Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.

Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname/.

Add a method to get the shared app gid from an uid or appid.

Bug: 26719109
Bug: 26563023
Change-Id: I89601d7dbeb3041df882c141a9127dac200a645e
2016-02-19 13:42:37 +00:00
Elliott Hughes
04f8fe722c Merge "Remove two bogus libutils dependencies." am: fd9619004b
am: b3639658ed

* commit 'b3639658ed307aca879007a88a74631f5feb6962':
  Remove two bogus libutils dependencies.
2016-02-17 21:07:30 +00:00
Elliott Hughes
b3639658ed Merge "Remove two bogus libutils dependencies."
am: fd9619004b

* commit 'fd9619004b8ce5be093657142aef989bee14fb82':
  Remove two bogus libutils dependencies.
2016-02-17 20:24:12 +00:00
Elliott Hughes
ce927189a4 Remove two bogus libutils dependencies.
Change-Id: Idcc25ee1d039935f3218fb419bc73ffaa58242bb
2016-02-17 11:54:47 -08:00
Bill Yi
4409f1446c Merge commit '4352ee87fd74b931d4b58192fb8974e91aa899d0' into HEAD 2016-02-17 11:37:00 -08:00
Mark Salyzyn
c47812a94f Merge "libcutils: abort for invalid fd" am: 76f99770d1
am: 8a0e1c51bd

* commit '8a0e1c51bdf42bcb3f1840173c27b097d106cd60':
  libcutils: abort for invalid fd
2016-02-05 18:15:14 +00:00
Mark Salyzyn
8a0e1c51bd Merge "libcutils: abort for invalid fd"
am: 76f99770d1

* commit '76f99770d12aedab21a9c2ecee82e5874db50bd1':
  libcutils: abort for invalid fd
2016-02-05 18:12:07 +00:00
Mark Salyzyn
76f99770d1 Merge "libcutils: abort for invalid fd" 2016-02-05 18:05:24 +00:00
Chih-hung Hsieh
e9163e7f39 Merge "Suppress false positive memory leak warnings." am: cfd44ee74f
am: 22ac670f67

* commit '22ac670f6793f743501c72b7b5bcacc015235652':
  Suppress false positive memory leak warnings.
2016-02-05 01:29:13 +00:00
Chih-hung Hsieh
22ac670f67 Merge "Suppress false positive memory leak warnings."
am: cfd44ee74f

* commit 'cfd44ee74f2318565d188ee0b2dd08911519d55e':
  Suppress false positive memory leak warnings.
2016-02-05 01:26:52 +00:00
Chih-Hung Hsieh
f7e7bd4c3b Suppress false positive memory leak warnings.
Clang static analyzer does not know the transfer of
object ownership to hashmapPut. Use a fake global
pointer variable to trick the analyzer.

BUG: 26955438
Change-Id: Id3ac595fff14e48d28a1147461cd836914857086
2016-02-04 16:38:04 -08:00
Mark Salyzyn
c92635f9ee Merge "libcutils: ashmem print error message for invalid fd" am: 9c551a1bec
am: ba6523a449

* commit 'ba6523a4496ecb6fa830f70c45a60fbfdd751c8b':
  libcutils: ashmem print error message for invalid fd
2016-02-04 02:34:59 +00:00
Mark Salyzyn
c759eac864 Merge "libcutils: ashmem check fd validity" am: 1a84f47794
am: c1003c78b7

* commit 'c1003c78b7e16d3e0ad78fab304249fd9d0e1e6b':
  libcutils: ashmem check fd validity
2016-02-04 02:34:52 +00:00
Mark Salyzyn
ba6523a449 Merge "libcutils: ashmem print error message for invalid fd"
am: 9c551a1bec

* commit '9c551a1bece6624bdbdfca40badc07b40b28ec1c':
  libcutils: ashmem print error message for invalid fd
2016-02-03 23:35:23 +00:00
Mark Salyzyn
c1003c78b7 Merge "libcutils: ashmem check fd validity"
am: 1a84f47794

* commit '1a84f47794168e80975eae31c665d03367929f66':
  libcutils: ashmem check fd validity
2016-02-03 23:35:10 +00:00
Mark Salyzyn
53c0ca6520 libcutils: abort for invalid fd
If ashmem accessors are being called with a file descriptor that
belongs to anything other than ashmem, we need to stop it right
now so that they can fix the caller.

Bug: 26871259
Change-Id: Icf9aafc3631a80b9af6fe0fea03599d61e285d21
2016-02-03 15:09:20 -08:00
Mark Salyzyn
e37111d751 libcutils: ashmem print error message for invalid fd
NB: We decided to not sniff for the constant saved __ashmem_rdev in
the early error path; requiring either the use of atomic operations,
or acquiring a lock to do it correctly. The heroics are not worth it.

Bug: 26871259
Change-Id: I46249838850ae32063eb5b7d08c731c5bb0fbf6b
2016-02-03 15:06:45 -08:00
Mark Salyzyn
1186f3a5ad libcutils: ashmem check fd validity
- collect st_rdev on open, or when required, for /dev/ashmem.
- check in all cases if fd is a character device and matches rdev.
- requires that we have open, read and write access to /dev/ashmem
  to check, assumption being that if we can not, then we have no
  right playing with the associated misdirected file descriptor.

NB: ashmem libcutil library entry points can no longer be called in
    signal context.

Bug: 26871259
Change-Id: I9a17e33317a9be795131473a51c16f761b5f7407
2016-02-03 13:05:22 -08:00
David Pursell
f722c253e6 Merge "libcutils/fastboot: improve multi-buffer write." am: f6f800ef3c
am: ef0e01c346

* commit 'ef0e01c346b2f60b1941bf3335906de5996785d8':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:13:02 +00:00
David Pursell
ef0e01c346 Merge "libcutils/fastboot: improve multi-buffer write."
am: f6f800ef3c

* commit 'f6f800ef3c4f7caef65f75bd6365a2045be488ea':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:09:24 +00:00
David Pursell
f6f800ef3c Merge "libcutils/fastboot: improve multi-buffer write." 2016-02-03 18:03:00 +00:00
David Pursell
b34e4a06ee libcutils/fastboot: improve multi-buffer write.
Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.

Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
2016-02-03 10:01:38 -08:00
Mark Salyzyn
af86f6e093 Merge "libcutils: ashmem fortify and comply with Android coding standard" am: 0e0a4628f6
am: a9bb866861

* commit 'a9bb866861766305482757d90b9263dcd648b90e':
  libcutils: ashmem fortify and comply with Android coding standard
2016-02-02 21:40:59 +00:00
Mark Salyzyn
a9bb866861 Merge "libcutils: ashmem fortify and comply with Android coding standard"
am: 0e0a4628f6

* commit '0e0a4628f6af7dc5f39d745098143699257dfbe6':
  libcutils: ashmem fortify and comply with Android coding standard
2016-02-02 21:38:19 +00:00
Mark Salyzyn
c2d8aad8d7 libcutils: ashmem fortify and comply with Android coding standard
- sort header order and in groups
- remove all tabs, use only spaces
- use TEMP_FAILURE_RETRY in system calls
- preserve errno for -1 return

Bug: 26871259
Change-Id: I94fffbcaeba01fcc18a3ed07c02389c06c54d3b7
2016-02-02 12:38:06 -08:00
David Pursell
2fe3a0b7a4 Merge "libcutils: add multi-buffer socket send." am: d95ecfc432
am: d56499b21d

* commit 'd56499b21d1411a7c799cdad316fb2138db26a7c':
  libcutils: add multi-buffer socket send.
2016-02-02 19:25:52 +00:00
David Pursell
d56499b21d Merge "libcutils: add multi-buffer socket send."
am: d95ecfc432

* commit 'd95ecfc432206d5408738bb7cbc6eb15e5827d91':
  libcutils: add multi-buffer socket send.
2016-02-02 19:23:51 +00:00
David Pursell
e03df480b1 Merge "libcutils: add socket_get_local_port()." am: d90adbc45b
am: 9875e6c7e3

* commit '9875e6c7e318fe11a888b6b53c0472f5586410e4':
  libcutils: add socket_get_local_port().
2016-02-02 19:21:39 +00:00
David Pursell
9875e6c7e3 Merge "libcutils: add socket_get_local_port()."
am: d90adbc45b

* commit 'd90adbc45b905dcf3e5cddcd2908b9307fc2a332':
  libcutils: add socket_get_local_port().
2016-02-02 19:19:27 +00:00
David Pursell
8385fb299f libcutils: add multi-buffer socket send.
Unix and Windows both have functions to write multiple buffers to a
socket with a single call but they have very different signatures. This
CL creates some cross-platform functions to be able to perform these
operations in a uniform way, which will be required for upcoming
fastboot functionality.

This CL also fixes some inconsistent spacing in the touched files.

Bug: http://b/26558551
Change-Id: I8f14d52d3a1de1f3b464267666d6cd3b54263238
2016-02-02 11:18:56 -08:00
David Pursell
756e1c81e8 libcutils: add socket_get_local_port().
Tests that require a local server currently hardcode a test value,
which can run into conflicts depending on what's currently running on
the machine.

This CL adds socket_get_local_port(), which lets us pass 0 so the
system picks an open port and we can query which port it chose.

Bug: http://b/26236380
Change-Id: I01d1558884e7636081d9a357db6faa86929934f6
2016-02-02 09:52:02 -08:00
Tim Murray
6647bb5130 Enable top-app cpuset support.
Allows ActivityManager to use the top-app cpuset to grant the currently
focused app exclusive access to a CPU core.

Change-Id: I45bca5170477e413dec6e5889338399d0859706c
2016-02-01 15:03:16 -08:00
Tim Murray
4284f9f3a3 Improve cpuset support for surfaceflinger.
SurfaceFlinger needs some of its threads in the system-background cpuset
and some of its threads (the binder pool) outside of the
system-background cpuset in order to improve UI perf/power
consumption. Remove surfaceflinger from the system-background cpuset in
init.rc and allow a thread to place itself in the system-background
cpuset given enough permissions.

bug 25745866

Change-Id: I85f7e41c5439e6ad7cc2d355e51f5dfb3a0c7088
2016-01-22 14:06:50 -08:00
David Pursell
f6012df68d Merge "fastboot: use cutils socket functions." am: bbedd9523f
am: f0bfaf9503

* commit 'f0bfaf95038241c3f8ed65099c7d532a6c112e86':
  fastboot: use cutils socket functions.
2016-01-22 18:46:54 +00:00
David Pursell
f0bfaf9503 Merge "fastboot: use cutils socket functions."
am: bbedd9523f

* commit 'bbedd9523faf2c56b9c8236b22658bb659eb1533':
  fastboot: use cutils socket functions.
2016-01-22 00:35:01 +00:00
David Pursell
572bce2908 fastboot: use cutils socket functions.
Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.

This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.

Bug: http://b/26558551

Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
2016-01-21 09:53:11 -08:00
David Pursell
cb56fb4b15 Merge "libcutils: share Windows networking code." am: 1906de1e0f
am: 7a568dbdd6

* commit '7a568dbdd6c1a39a90c01ab89092cb67a9a86198':
  libcutils: share Windows networking code.
2016-01-21 17:03:45 +00:00
David Pursell
7a568dbdd6 Merge "libcutils: share Windows networking code."
am: 1906de1e0f

* commit '1906de1e0fb70dbae4a713620072113a76d0a22a':
  libcutils: share Windows networking code.
2016-01-21 17:00:57 +00:00
David Pursell
1906de1e0f Merge "libcutils: share Windows networking code." 2016-01-21 16:40:00 +00:00
Nick Kralevich
974bf66088 Merge "logging: avoid unnecessary printfs" am: 542a511f87
am: 5644112b7e

* commit '5644112b7e05372fcda105fa621630c12ec29a6e':
  logging: avoid unnecessary printfs
2016-01-19 18:10:37 +00:00
Nick Kralevich
5644112b7e Merge "logging: avoid unnecessary printfs"
am: 542a511f87

* commit '542a511f870f33215ec3b4773fc7a85ac9134f26':
  logging: avoid unnecessary printfs
2016-01-19 18:08:47 +00:00
Nick Kralevich
5db8d6aafa logging: avoid unnecessary printfs
Don't spend CPU cycles formatting a bunch of strings if we're
just going to throw them away later. Maybe make booting faster.

Change-Id: I4d8eb99fb3fa873ca91cf776933d0ad01988abf5
2016-01-16 16:20:24 -08:00
David Pursell
0eb8e1b706 libcutils: share Windows networking code.
This CL moves Windows networking code from fastboot to libcutils so
that it can be shared with other host programs such as adb.

Not all libcutils networking functions have been implemented for
Windows, just those necessary for fastboot. In the next CL I will do
the same for adb, adding any additional required functions.

Unit tests have also been added to test the functions using a loopback
connection.

Bug: http://b/26236380.
Change-Id: Ibc51a67030fe69a04c23512eefa9d19b055c7c12
2016-01-15 15:57:35 -08:00
Jeff Sharkey
814640315a Be strict, but not that strict.
Certain apps decide that they want to chmod() their private data
directories to gain more security.  We still want to carefully
enforce owner UID/GID, but relax the mode check for now.

Bug: 26549892
Change-Id: I362d530ba0b20fb23f427ac082ee003864adc57d
2016-01-14 12:02:53 -07:00
Jeff Sharkey
cf94fe152e Offer a stricter way to prepare directories.
Some callers, such as installd, have stricter requirements around
directory preparation, where they want to assert ownership and mode
without quietly fixing the values.

Bug: 26466827
Change-Id: Id44db5f29a3326cfe178b443fb450ad2edeaefd8
2016-01-12 13:07:52 -07:00
Nick Kralevich
2af9135b8a Merge "trace-dev.c: more O_CLOEXEC" am: a8d3fdf4c6
am: 2dda6ac98d

* commit '2dda6ac98d2e82adaebd443f468eff060961f1c6':
  trace-dev.c: more O_CLOEXEC
2015-12-16 14:20:39 -08:00
Nick Kralevich
2dda6ac98d Merge "trace-dev.c: more O_CLOEXEC"
am: a8d3fdf4c6

* commit 'a8d3fdf4c62b485073b439ed46b4814f1608f77a':
  trace-dev.c: more O_CLOEXEC
2015-12-16 21:50:01 +00:00
Nick Kralevich
dee1ef48a9 trace-dev.c: more O_CLOEXEC
Stop the file descriptors from leaking.

Change-Id: Ib5ca1c2e5031fbec8751bde9e86b32e51e10fcbc
2015-12-16 12:32:26 -08:00
Elliott Hughes
02903348f8 Merge "Make host ashmem_create_region more robust." am: ec2f506e74
am: 6ed33e5ada

* commit '6ed33e5ada7e7a1f7d4f0a0407850021169893d3':
  Make host ashmem_create_region more robust.
2015-12-16 18:44:31 +00:00
Elliott Hughes
6ed33e5ada Merge "Make host ashmem_create_region more robust."
am: ec2f506e74

* commit 'ec2f506e741bbc9252d25f0f2ba1c24b1aa0ab7d':
  Make host ashmem_create_region more robust.
2015-12-16 18:40:04 +00:00
Elliott Hughes
3918090252 Make host ashmem_create_region more robust.
Don't clobber errno if mkstemp failed, always unlink, and only count
mkstemp/ftruncate failures as real failures --- if only the unlink
fails, there's no point not using what we have.

Change-Id: I6bc788682c88651a50a6316b9ca07ba07e9fefa2
2015-12-16 08:33:52 -08:00
Erik Kline
f3501658af Merge "Listen on dualstack sockets." am: 1f7bcf3e93 am: f6df8fce6d
am: 4cb2c1fbb6

* commit '4cb2c1fbb60b5b4684bdd01c140eb82e1c397e3c':
  Listen on dualstack sockets.
2015-12-08 06:38:12 +00:00
Erik Kline
4cb2c1fbb6 Merge "Listen on dualstack sockets." am: 1f7bcf3e93
am: f6df8fce6d

* commit 'f6df8fce6d0bea7da34e2e16edc691881b92105a':
  Listen on dualstack sockets.
2015-12-07 22:35:10 -08:00
Todd Kennedy
088113f419 Merge "Create new ephemeral app directory" 2015-12-07 15:33:06 +00:00
Erik Kline
c40da92e5b Listen on dualstack sockets.
Change-Id: Id6eff59c65a7f7e190ab9aa93625e32a9806ae6c
2015-12-07 16:09:39 +09:00
Nick Kralevich
aa68a571b4 Merge "fs_config.c: Remove obsolete reference to /system/bin/pppd-ril" am: e08e4656db
am: 9efbfda576

* commit '9efbfda5764c8d2a1abb4a4e88caf0aa3c9c92ea':
  fs_config.c: Remove obsolete reference to /system/bin/pppd-ril
2015-11-30 18:49:28 +00:00
Nick Kralevich
cbbc66174c fs_config.c: Remove obsolete reference to /system/bin/pppd-ril
Codesearch finds no reference to this in the Android tree. It was
added in 2010 in commit bbf1c64527.

Change-Id: I8cd1153912b78b4b23b8f5ba2577a58c5c49e316
2015-11-30 09:17:18 -08:00
Nick Kralevich
cb2202f614 Merge "fs_config: remove setuid bit from librank" am: 0380d49024
am: dee5c24927

* commit 'dee5c24927754c7a3213a3118f53cb119f00ad85':
  fs_config: remove setuid bit from librank
2015-11-30 14:57:05 +00:00
Nick Kralevich
3e6356834f fs_config: remove setuid bit from librank
Anyone wanting to call /system/xbin/librank can execute "su"
beforehand. There's no need for it to be setuid root.

Bug: 25739721
Change-Id: Ie3d68701397d21e901bf1ec17b4b4a9f12128d2d
2015-11-27 18:08:22 -08:00
Josh Gao
d9a3f0b65f Merge changes I36b66fc5,I0561affb am: 166e716851
am: 8e82180c83

* commit '8e82180c83eb89069716fb790ed0f006e469be1c':
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:20:44 +00:00
Josh Gao
1175d0fdb0 libcutils: turn on -Werror on Win32, fix resulting build break.
Mingw doesn't provide strndup or strtok_r used in str_parms.c, resulting in
-Wimplicit-function-declaration being emitted for the Windows build.
None of the consumers of str_parms.c appear to be compiled for Windows,
so we can just remove it from the Windows build.

Change-Id: I36b66fc54ed261d38f5294bc8662ddb2db4fe64f
2015-11-24 09:35:45 -08:00
Josh Gao
9e86f8e036 libcutils: add prefix to local variables in Android.mk.
Change-Id: I0561affbcc306c20f8aa87beb2d9728a9bb79f5e
2015-11-24 08:45:07 -08:00
Todd Kennedy
0a2733582d Create new ephemeral app directory
Bug: 25119046
Change-Id: Ie005430700a73ef1ba492dae4101419a41da4071
2015-11-23 15:24:13 -08:00
Josh Gao
7454190acd Merge "Revert "libcutils: don\'t build for Windows."" am: 39a1b77381 am: 167b4bed93
am: 5153be7f94

* commit '5153be7f94046cf2e7e34060f9d5ae4866abb015':
  Revert "libcutils: don't build for Windows."
2015-11-18 19:17:54 +00:00
Josh Gao
b5d763b053 Merge changes Ice07f892,Ie1f082a0 am: 74a33fbcef am: 053eba0bc1
am: cb601eb981

* commit 'cb601eb981f70d395e9bac5c1bf39c7773141eca':
  libcutils: don't build for Windows.
  adb: don't link against libcutils on Windows.
2015-11-18 19:17:39 +00:00
Todd Kjos
88b5892d74 resolve merge conflicts of ed60788968 to mnc-dr2-dev-plus-aosp.
Change-Id: I9b07dd8dcb8fc74b658466b8dd47546cefffab1d
2015-11-18 08:31:03 -08:00
Josh Gao
cab716f101 Revert "libcutils: don't build for Windows."
This reverts commit bb3f9ce0aa.
2015-11-17 14:28:33 -08:00
Josh Gao
bb3f9ce0aa libcutils: don't build for Windows.
Change-Id: Ice07f892a346bbba2ed6bfdcddf7222799e76f9d
2015-11-16 16:21:22 -08:00
Todd Kjos
ba8a47531c Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 14:57:47 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Gilad Arnold
1bc7888104 Fix permissions for /data/nativetest{,64}/tests.txt.
This is not an executable so we have to specifically set its permissions
accordingly.

Bug: 25668833
Change-Id: I502f69bad75b4da4fdc29eb3ebaa42a19ae04d27
2015-11-14 18:25:31 -08:00
Gilad Arnold
47af47f4c1 Sane ownership/permissions for directories in /data/nativetest{,64}.
This makes native test directories 750 root:shell. This matches the
value for files within those directories, and results in a more usable
access paradigm when (say) unprivileged test tools need to discover
these test binaries.

Bug: 25668833
Change-Id: I9bd2081b2c211b4383b5873238aaf64597756714
2015-11-12 14:34:57 -08:00
Daniel Erat
5510c13991 libcutils: Make /data/nativetest{,64}/* executable.
Make test files under /data/nativetest{,64} 0750 root:shell
to avoid needing to manually chmod them.

Bug: 25340994
Change-Id: I174cc226195907c0effa99063a8aa0082f85722b
2015-11-02 09:45:04 -07:00
Christopher Ferris
634df89db6 Make allocations use unique_ptr.
Change-Id: I4b84b8106faeaeb61847f8f9d13fd6444f474efd
2015-10-14 14:03:29 -07:00
Nick Kralevich
e2b2996d96 fs_config.c: remove setuid from procrank
procrank only exists on userdebug/eng builds. For those builds,
procrank can be executed by running "su 0 procrank" instead of
relying on the binary being setuid root. This reduces the number
of setuid binaries on Android and allows for the deletion of
SELinux policy to support this.

Bug: 18342188
Change-Id: I982283f2e0f6fbe5efaffc08501c1ec175f65373
2015-10-07 16:41:47 -07:00
Jorge Lucangeli Obes
fd7a9f79f2 am 66d32c74: Merge "Use CAP_MASK_LONG for file capabilities."
* commit '66d32c7488e12545218e83195738c95c183760ef':
  Use CAP_MASK_LONG for file capabilities.
2015-09-03 15:55:32 +00:00
Jorge Lucangeli Obes
66d32c7488 Merge "Use CAP_MASK_LONG for file capabilities." 2015-09-03 15:48:01 +00:00
Dan Willemsen
a4b8f9f1c2 am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Jorge Lucangeli Obes
e920c46e7d Use CAP_MASK_LONG for file capabilities.
Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid
repeating it.

Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98
2015-09-02 17:18:44 -07:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Nick Kralevich
eb45890579 am f4355868: Merge "android_memset.c: Use sanitized shifts"
* commit 'f4355868cbce0713331bbb04b063515d6de4c795':
  android_memset.c: Use sanitized shifts
2015-08-27 23:24:35 +00:00
Duane Sand
c348a88376 android_memset.c: Use sanitized shifts
Avoid checks and traps on msb=1 unsigned shifts.

Change-Id: I5203a4290296b5557c0420ce0debad3b60d48233
2015-08-27 14:32:17 -07:00
Nick Kralevich
b7699c6550 am e6d3cf39: Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))"
* commit 'e6d3cf393749556d6bb6b8ea51bb1252cfb061f3':
  android_memset.c: Use __attribute__((no_sanitize("integer")))
2015-08-27 20:44:40 +00:00
Nick Kralevich
d9eda62875 android_memset.c: Use __attribute__((no_sanitize("integer")))
Turn off integer sanitization on android_memset. memset()ing is
expected to be a fast operation.

Avoid the use of the "while (size--) { }" construct, which harmlessly
underflows.

Change-Id: Ia61ff2323c759bf52df7e70b8be2fae0b0366dda
2015-08-27 13:14:36 -07:00
Nick Kralevich
212e4f1fe1 am d34f4198: Merge "strdup16to8.c: fix benign integer underflow."
* commit 'd34f419826e74640dfe88c50d171a0cd8580eeda':
  strdup16to8.c: fix benign integer underflow.
2015-08-27 18:01:44 +00:00
Nick Kralevich
2b98a9eec0 strdup16to8.c: fix benign integer underflow.
A size_t value is not allowed to go below zero.

Change-Id: Ic888c6605d911e0b5dbee1a2fe1daf41e616e106
2015-08-27 10:30:50 -07:00
Nick Kralevich
3192689b21 am 63141512: am 53f11b62: Merge "libcutils: enable LOCAL_SANITIZE := integer"
* commit '631415129c51a24cd5c9843694bd5283fe3b9345':
  libcutils: enable LOCAL_SANITIZE := integer
2015-08-26 18:51:02 +00:00
Nick Kralevich
78d632a01d am 38f4a139: am 532e6cde: Merge "libcutils: cleanups for -fsanitize=integer"
* commit '38f4a1391e499c2392cd8136061153cc35438eb3':
  libcutils: cleanups for -fsanitize=integer
2015-08-26 18:51:00 +00:00
Nick Kralevich
fc82dd9179 libcutils: enable LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Tested on Nexus 5 and Nexus 9 with no obvious problems.

Change-Id: I6cb28b4a0f5feed69ea472dfac8804fb0bf99719
2015-08-26 11:32:31 -07:00
Nick Kralevich
7390478f19 libcutils: cleanups for -fsanitize=integer
Hash functions rely on overflow behavior, so whitelist them.

ATRACE_TAG_NOT_READY: use an unsigned constant when shifting bits.
Otherwise, the value overflows on shift. The users of this constant
assign it to a uint64_t variable.

Change-Id: I21c437ce2083525e906c3ead3259ec34a1ef4b66
2015-08-26 10:40:00 -07:00
Elliott Hughes
145afc2cc4 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:15 +00:00
Elliott Hughes
e6e71608bd Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS." 2015-07-30 16:34:47 +00:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
c6dbc85845 am 42dbc4b1: am 44443bea: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
  Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:17:07 +00:00
Elliott Hughes
adbf442a51 Use _WIN32 rather than HAVE_WINSOCK.
Change-Id: I9855b6fe72e2f2f3a8360c0993a67cb988024ee4
2015-07-29 17:45:24 -07:00
Tao Bao
5c151c4a4b am beb13044: am 1cae8cc1: Merge "Set mode bits for /system/etc/recovery.img."
* commit 'beb1304469c916bedf625ab126d75b38a688c62f':
  Set mode bits for /system/etc/recovery.img.
2015-07-28 21:24:21 +00:00
Tao Bao
1cae8cc13a Merge "Set mode bits for /system/etc/recovery.img." 2015-07-28 20:47:00 +00:00
Tao Bao
c6e93fec84 Set mode bits for /system/etc/recovery.img.
/system/etc/recovery.img defaults to 0644. Change it to 0440.

Bug: 22641135
Change-Id: I45cdb0cc1b58f35fbcd0f16e7cc6c4eef63b0b74
(cherry picked from commit b602e6f9a3)
2015-07-27 19:17:15 -07:00
Elliott Hughes
8a8953bb3d Fix libcutils build.
Change-Id: I4df2065f60f5363877809161298c1f9718252934
2015-07-24 20:28:31 -07:00
Elliott Hughes
3dced0d2c6 am 12d912bc: am ed217967: Merge "Fix socket_network_client_timeout error check."
* commit '12d912bc4facd9490becd9d1306a54fd079a8800':
  Fix socket_network_client_timeout error check.
2015-07-25 03:06:47 +00:00
Elliott Hughes
8b262b9de4 resolved conflicts for merge of 038b76c2 to mnc-dev-plus-aosp
Change-Id: Id84946b67f207a7586cfa9c918ee6e4ae335fe86
2015-07-24 20:02:31 -07:00
Elliott Hughes
ed21796754 Merge "Fix socket_network_client_timeout error check." 2015-07-25 01:58:57 +00:00
Elliott Hughes
eabe8af7e3 Fix socket_network_client_timeout error check.
Change-Id: Ia30ffc1a7815c63d247d9ba298c2fe9d7a780af2
2015-07-24 18:54:02 -07:00
Elliott Hughes
8fea1ede67 Turn on warnings for libcutils, fix a bug.
This doesn't actually spot the bug I'm about to fix, but maybe one day...

Change-Id: Ib8a2016ecd8a426f38960a05d439646255ea6cd8
2015-07-24 18:48:31 -07:00
Elliott Hughes
5937a860f3 am 1f76c1ab: am 9727a6a0: Merge "Report getaddrinfo failures correctly."
* commit '1f76c1abea3196a61f85164a078d44505d3a6b5e':
  Report getaddrinfo failures correctly.
2015-07-24 21:02:36 +00:00
Elliott Hughes
381cfa9a8b Report getaddrinfo failures correctly.
Also move us off the "convenience" function because you can't get useful
error reporting from it.

Change-Id: I5fcc6a6d762f5f60906980a7835f01a35045be65
2015-07-23 21:14:38 -07:00
Yusuke Sato
7c842b57fe am ab64465d: am 0e3ce82b: Merge "Use fsck.f2fs -a instead of -f for faster boot"
* commit 'ab64465d1f16f414c0bde5e3c4707c32b8220bbc':
  Use fsck.f2fs -a instead of -f for faster boot
2015-07-21 18:25:57 +00:00
Yusuke Sato
0e3ce82b94 Merge "Use fsck.f2fs -a instead of -f for faster boot" 2015-07-21 16:06:40 +00:00
Elliott Hughes
32cfa95271 am 099ec31b: am ff201659: Merge "Fix the Mac libcutils build."
* commit '099ec31bdb910020c5c86b4ad8711940616bcbaf':
  Fix the Mac libcutils build.
2015-07-18 18:21:13 +00:00
Elliott Hughes
0f8f70beb4 Fix the Mac libcutils build.
The stupid Mac doesn't have SOCK_NONBLOCK.

Bug: http://b/22559299
Change-Id: I476dadd0ba0076f5e61a4cd9b1f39cf3508f4188
2015-07-18 10:47:59 -07:00
Elliott Hughes
cb599d34b9 am 5403d155: am e36b10a8: Merge "Switch libcutils from gethostbyname to getaddrinfo."
* commit '5403d155a3677ff334246eb5524ced4166fd1c96':
  Switch libcutils from gethostbyname to getaddrinfo.
2015-07-18 17:20:13 +00:00
Elliott Hughes
94ae41874a Switch libcutils from gethostbyname to getaddrinfo.
Needed for IPv6 support.

Bug: http://b/22559299
Change-Id: Id10d958b434b207e84bc2ec2ff83221f2c4e8168
2015-07-17 23:45:15 -07:00
Yusuke Sato
0df08271fb Use fsck.f2fs -a instead of -f for faster boot
and run fsck with -f on clean shutdown instead.

With -f, fsck.f2fs always performs a full scan of the /data
partition regardless of whether the partition is clean or not.
The full scan takes more than 2 seconds on volantis-userdebug
and delays the OS boot.

With -a, the command does almost nothing when the partition
is clean and finishes within 20-30ms on volantis-userdebug.
When the partition has an error or its check point has
CP_FSCK_FLAG (aka "need_fsck"), the command does exactly the
same full scan as -f to fix it.

Bug: 21853106
Change-Id: I126263caf34c0f5bb8f5e6794454d4e72526ce38
2015-07-15 10:13:51 -07:00
Daniel Rosenberg
6b6687bec9 am 00392411: am e7ed68ad: Merge "libcutils: fs_config: Add folders normally created in init.rc"
* commit '0039241124ae3ef9b19c805b0341120e11f9561e':
  libcutils: fs_config: Add folders normally created in init.rc
2015-07-14 22:28:11 +00:00
Thierry Strudel
a0fbb90885 am 8703bea1: Merge "fs_config: replace getenv(\'OUT\') by new fs_config parameter" into mnc-dev
* commit '8703bea1807326fef9835bc474e7a7288c725925':
  fs_config: replace getenv('OUT') by new fs_config parameter
  fs_mgr: Use ro.boot.veritymode
2015-07-10 18:44:51 +00:00
Thierry Strudel
df33ffadd2 fs_config: replace getenv('OUT') by new fs_config parameter
Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.

Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-09 21:47:07 -07:00
Daniel Rosenberg
bbe796d231 libcutils: fs_config: Add folders normally created in init.rc
When the ramdisk is built into the system image, we need to create
those folders during the build.

Change-Id: I40881940c75e379d7599dc1f743b35fbc7cc66e8
2015-07-08 16:37:13 -07:00
Todd Kjos
7c3e2696c5 am 1fb6e24f: Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev
* commit '1fb6e24f19533c2d7bfa1e8e69443d752e9df3ce':
  Fix janky navbar ripples -- incorrect timerslack values
2015-06-29 22:55:34 +00:00
Todd Kjos
1fb6e24f19 Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev 2015-06-29 22:29:54 +00:00
Todd Kjos
4cdce427f9 Fix janky navbar ripples -- incorrect timerslack values
If a thread is created while the parent thread is "Background",
then the default timerslack value gets set to the current
timerslack value of the parent (40ms). The default value is
used when transitioning to "Foreground" -- so the effect is that
the timerslack value becomes 40ms regardless of foreground/background.

This does occur intermittently for systemui when creating its
render thread (pretty often on hammerhead and has been seen on
shamu). If this occurs, then some systemui animations like navbar
ripples can wait for up to 40ms to draw a frame when they intended
to wait 3ms -- jank.

This fix is to explicitly set the foreground timerslack to 50us.

A consequence of setting timerslack behind the process' back is
that any custom values for timerslack get lost whenever the thread
has transition between fg/bg.

See Bug: 19398120

Change-Id: Idc259717f62fa2255f8bafbbf88b68c0043f29cf
2015-06-25 14:29:07 -07:00
Tim Murray
f7180d1d2d am 98c6de69: Merge "Don\'t set cgroup policy when updating cpusets." into mnc-dev
* commit '98c6de6926e65615caff5be72236a24339258dee':
  Don't set cgroup policy when updating cpusets.
2015-06-22 22:09:19 +00:00
Tim Murray
999102664c Don't set cgroup policy when updating cpusets.
bug 21782794

Change-Id: I3b2cf8ae4f3ed0c14f206584ae7fa2b1a1d11ad0
2015-06-22 14:00:56 -07:00
Tim Murray
63e383136b am e5b0c837: Merge "add cpuset support to libcutils" into mnc-dev
* commit 'e5b0c837856007812ace8ec5849f6852015d5d2b':
  add cpuset support to libcutils
2015-06-12 19:03:30 +00:00
Tim Murray
b769c8d24f add cpuset support to libcutils
bug 21782794

Change-Id: I249531754fb29442dc3c7434d77dbb103f4220a7
2015-06-11 18:35:46 -07:00
Elliott Hughes
af02e2403a am 9fc83437: Don\'t use TEMP_FAILURE_RETRY on close in system/core.
* commit '9fc834377297cb2dcc418e4ce7e38e89dd09812b':
  Don't use TEMP_FAILURE_RETRY on close in system/core.
2015-05-27 20:51:25 +00:00
Elliott Hughes
9fc8343772 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
(cherry picked from commit 47b0134ec2)
2015-05-27 13:27:06 -07:00
Elliott Hughes
3464c77b8d Merge "Don't use TEMP_FAILURE_RETRY on close in system/core." 2015-05-27 20:24:08 +00:00
Nick Kralevich
27fe3cb63f am 7eb3abdb: klog: don\'t unconditionally call mknod()
* commit '7eb3abdb3ba500d3acca82b95705f34128251015':
  klog: don't unconditionally call mknod()
2015-05-19 23:03:19 +00:00
Nick Kralevich
7eb3abdb3b klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

(cherrypicked from commit 4d32a486fe)

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-19 15:19:25 -07:00
Nick Kralevich
4d32a486fe klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-18 18:43:28 -07:00
Adam Lesinski
b278ab2f0f am 0ebd13f0: Merge "Prevent integer overflow when allocating native_handle_t" into mnc-dev
* commit '0ebd13f0639ddfc3e6e96bbcc6ce5465ca489808':
  Prevent integer overflow when allocating native_handle_t
2015-05-19 00:55:12 +00:00
Elliott Hughes
47b0134ec2 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
2015-05-15 19:16:40 -07:00
Adam Lesinski
07edc3b3b3 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-15 13:09:39 -07:00
Dan Albert
428fad97a0 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Bug: 19517541

(cherry picked from commit 23f750b068)

Change-Id: I2f888e8ed7a2f5719973786cbcbb399a81867ee9
2015-05-13 13:44:34 -07:00
Dan Albert
cd206b3900 Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it.

Bug: 19517541

(cherry picked from commit b3a36ca5ee)

Change-Id: Ifbd5d19e506e7313700e2e29a2dae5736e049844
2015-05-13 13:43:32 -07:00
Elliott Hughes
36284db817 Switch arch-arm/memset32.S to unified syntax.
This fixes the clang build.

Change-Id: I492c7dc016986020de3f70a77e0ace6610f50765
2015-05-11 22:22:13 -07:00
Dan Albert
23f750b068 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Change-Id: I9e14f9176b167405a5aaa5b8a0db0327c7126271
2015-04-30 12:52:21 -07:00