Merge "liblp: Implement support for request queue alignment."
diff --git a/adb/daemon/file_sync_service.cpp b/adb/daemon/file_sync_service.cpp
index 1128993..f7be8f9 100644
--- a/adb/daemon/file_sync_service.cpp
+++ b/adb/daemon/file_sync_service.cpp
@@ -69,17 +69,23 @@
}
static bool secure_mkdirs(const std::string& path) {
- uid_t uid = -1;
- gid_t gid = -1;
- unsigned int mode = 0775;
- uint64_t capabilities = 0;
-
if (path[0] != '/') return false;
std::vector<std::string> path_components = android::base::Split(path, "/");
std::string partial_path;
for (const auto& path_component : path_components) {
- if (partial_path.back() != OS_PATH_SEPARATOR) partial_path += OS_PATH_SEPARATOR;
+ uid_t uid = -1;
+ gid_t gid = -1;
+ unsigned int mode = 0775;
+ uint64_t capabilities = 0;
+
+ if (path_component.empty()) {
+ continue;
+ }
+
+ if (partial_path.empty() || partial_path.back() != OS_PATH_SEPARATOR) {
+ partial_path += OS_PATH_SEPARATOR;
+ }
partial_path += path_component;
if (should_use_fs_config(partial_path)) {
diff --git a/adb/test_device.py b/adb/test_device.py
index f995be2..5aa2684 100644
--- a/adb/test_device.py
+++ b/adb/test_device.py
@@ -866,6 +866,21 @@
self.assertTrue('Permission denied' in output or
'Read-only file system' in output)
+ @requires_non_root
+ def test_push_directory_creation(self):
+ """Regression test for directory creation.
+
+ Bug: http://b/110953234
+ """
+ with tempfile.NamedTemporaryFile() as tmp_file:
+ tmp_file.write('\0' * 1024 * 1024)
+ tmp_file.flush()
+ remote_path = self.DEVICE_TEMP_DIR + '/test_push_directory_creation'
+ self.device.shell(['rm', '-rf', remote_path])
+
+ remote_path += '/filename'
+ self.device.push(local=tmp_file.name, remote=remote_path)
+
def _test_pull(self, remote_file, checksum):
tmp_write = tempfile.NamedTemporaryFile(mode='wb', delete=False)
tmp_write.close()
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp
index 1f6f3c8..8bdc02f 100644
--- a/debuggerd/libdebuggerd/utility.cpp
+++ b/debuggerd/libdebuggerd/utility.cpp
@@ -287,9 +287,7 @@
case SIGFPE: return "SIGFPE";
case SIGILL: return "SIGILL";
case SIGSEGV: return "SIGSEGV";
-#if defined(SIGSTKFLT)
case SIGSTKFLT: return "SIGSTKFLT";
-#endif
case SIGSTOP: return "SIGSTOP";
case SIGSYS: return "SIGSYS";
case SIGTRAP: return "SIGTRAP";
@@ -311,8 +309,14 @@
case ILL_PRVREG: return "ILL_PRVREG";
case ILL_COPROC: return "ILL_COPROC";
case ILL_BADSTK: return "ILL_BADSTK";
+ case ILL_BADIADDR:
+ return "ILL_BADIADDR";
+ case __ILL_BREAK:
+ return "ILL_BREAK";
+ case __ILL_BNDMOD:
+ return "ILL_BNDMOD";
}
- static_assert(NSIGILL == ILL_BADSTK, "missing ILL_* si_code");
+ static_assert(NSIGILL == __ILL_BNDMOD, "missing ILL_* si_code");
break;
case SIGBUS:
switch (si->si_code) {
@@ -334,36 +338,44 @@
case FPE_FLTRES: return "FPE_FLTRES";
case FPE_FLTINV: return "FPE_FLTINV";
case FPE_FLTSUB: return "FPE_FLTSUB";
+ case __FPE_DECOVF:
+ return "FPE_DECOVF";
+ case __FPE_DECDIV:
+ return "FPE_DECDIV";
+ case __FPE_DECERR:
+ return "FPE_DECERR";
+ case __FPE_INVASC:
+ return "FPE_INVASC";
+ case __FPE_INVDEC:
+ return "FPE_INVDEC";
+ case FPE_FLTUNK:
+ return "FPE_FLTUNK";
+ case FPE_CONDTRAP:
+ return "FPE_CONDTRAP";
}
- static_assert(NSIGFPE == FPE_FLTSUB, "missing FPE_* si_code");
+ static_assert(NSIGFPE == FPE_CONDTRAP, "missing FPE_* si_code");
break;
case SIGSEGV:
switch (si->si_code) {
case SEGV_MAPERR: return "SEGV_MAPERR";
case SEGV_ACCERR: return "SEGV_ACCERR";
-#if defined(SEGV_BNDERR)
case SEGV_BNDERR: return "SEGV_BNDERR";
-#endif
-#if defined(SEGV_PKUERR)
case SEGV_PKUERR: return "SEGV_PKUERR";
-#endif
+ case SEGV_ACCADI:
+ return "SEGV_ACCADI";
+ case SEGV_ADIDERR:
+ return "SEGV_ADIDERR";
+ case SEGV_ADIPERR:
+ return "SEGV_ADIPERR";
}
-#if defined(SEGV_PKUERR)
- static_assert(NSIGSEGV == SEGV_PKUERR, "missing SEGV_* si_code");
-#elif defined(SEGV_BNDERR)
- static_assert(NSIGSEGV == SEGV_BNDERR, "missing SEGV_* si_code");
-#else
- static_assert(NSIGSEGV == SEGV_ACCERR, "missing SEGV_* si_code");
-#endif
+ static_assert(NSIGSEGV == SEGV_ADIPERR, "missing SEGV_* si_code");
break;
-#if defined(SYS_SECCOMP) // Our glibc is too old, and we build this for the host too.
case SIGSYS:
switch (si->si_code) {
case SYS_SECCOMP: return "SYS_SECCOMP";
}
static_assert(NSIGSYS == SYS_SECCOMP, "missing SYS_* si_code");
break;
-#endif
case SIGTRAP:
switch (si->si_code) {
case TRAP_BRKPT: return "TRAP_BRKPT";