Merge "init: report shutdown,container for sigterm of init"
diff --git a/adb/test_device.py b/adb/test_device.py
index 9e1a2ec..ddceda9 100644
--- a/adb/test_device.py
+++ b/adb/test_device.py
@@ -1237,7 +1237,7 @@
return m.group(2)
return None
- def test_killed_when_pushing_a_large_file(self):
+ def disabled_test_killed_when_pushing_a_large_file(self):
"""
While running adb push with a large file, kill adb server.
Occasionally the device becomes offline. Because the device is still
@@ -1268,7 +1268,7 @@
# 4. The device should be online
self.assertEqual(self._get_device_state(serialno), 'device')
- def test_killed_when_pulling_a_large_file(self):
+ def disabled_test_killed_when_pulling_a_large_file(self):
"""
While running adb pull with a large file, kill adb server.
Occasionally the device can't be connected. Because the device is trying to
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 1b597fd..34cc026 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -748,9 +748,6 @@
}
int atransport::Write(apacket* p) {
-#if ADB_HOST
- std::lock_guard<std::mutex> lock(write_msg_lock_);
-#endif
return write_func_(p, this);
}
@@ -758,11 +755,6 @@
if (!kicked_) {
kicked_ = true;
CHECK(kick_func_ != nullptr);
-#if ADB_HOST
- // On host, adb server should avoid writing part of a packet, so don't
- // kick a transport whiling writing a packet.
- std::lock_guard<std::mutex> lock(write_msg_lock_);
-#endif
kick_func_(this);
}
}
diff --git a/adb/transport.h b/adb/transport.h
index 374bfc3..79e3075 100644
--- a/adb/transport.h
+++ b/adb/transport.h
@@ -181,7 +181,6 @@
std::atomic<ConnectionState> connection_state_;
#if ADB_HOST
std::deque<std::shared_ptr<RSA>> keys_;
- std::mutex write_msg_lock_;
bool has_send_connect_on_error_ = false;
#endif
diff --git a/init/init.cpp b/init/init.cpp
index dbe833f..ad045b1 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -568,8 +568,7 @@
epoll_fd = epoll_create1(EPOLL_CLOEXEC);
if (epoll_fd == -1) {
- PLOG(ERROR) << "epoll_create1 failed";
- exit(1);
+ PLOG(FATAL) << "epoll_create1 failed";
}
sigchld_handler_init();
diff --git a/init/property_service.cpp b/init/property_service.cpp
index db2d472..0df96bf 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -73,8 +73,7 @@
void property_init() {
if (__system_property_area_init()) {
- LOG(ERROR) << "Failed to initialize property area";
- exit(1);
+ LOG(FATAL) << "Failed to initialize property area";
}
}
@@ -216,7 +215,7 @@
LOG(ERROR) << "property_set_async(\"" << info.name << "\", \"" << info.value
<< "\") failed";
}
- exit(0);
+ _exit(0);
}
}
@@ -712,8 +711,7 @@
property_set_fd = CreateSocket(PROP_SERVICE_NAME, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
false, 0666, 0, 0, nullptr);
if (property_set_fd == -1) {
- PLOG(ERROR) << "start_property_service socket creation failed";
- exit(1);
+ PLOG(FATAL) << "start_property_service socket creation failed";
}
listen(property_set_fd, 8);
diff --git a/init/sigchld_handler.cpp b/init/sigchld_handler.cpp
index 8fc9956..fa67199 100644
--- a/init/sigchld_handler.cpp
+++ b/init/sigchld_handler.cpp
@@ -119,8 +119,7 @@
// Create a signalling mechanism for SIGCHLD.
int s[2];
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0, s) == -1) {
- PLOG(ERROR) << "socketpair failed";
- exit(1);
+ PLOG(FATAL) << "socketpair failed in sigchld_handler_init";
}
signal_write_fd = s[0];