Skip to content

Commit 0b250ac

Browse files
Treehugger Robotcjreynol
authored andcommitted
[skip ci] Merge changes I96a780dd,Ib9784443,Ia8f6138b,Id1cdced0,Ice1d9983, ... into main
* changes: Check for errors from EnsureDirectoryExists/RenameFile sensor_injection: Stop using getService ril: Move from volatile to std::atomic ril: Suppress warnings from libradiocompat VehicleService: Drop unused 'connected' variable websocket: Fix initialization order warnings GitOrigin-RevId: 8adc254
1 parent 28fe339 commit 0b250ac

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

staging/common/libs/utils/files.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Result<void> EnsureDirectoryExists(const std::string& directory_path,
186186
}
187187
const auto parent_dir = android::base::Dirname(directory_path);
188188
if (parent_dir.size() > 1) {
189-
EnsureDirectoryExists(parent_dir, mode, group_name);
189+
CF_EXPECT(EnsureDirectoryExists(parent_dir, mode, group_name));
190190
}
191191
LOG(VERBOSE) << "Setting up " << directory_path;
192192
if (mkdir(directory_path.c_str(), mode) < 0 && errno != EEXIST) {

staging/host/commands/assemble_cvd/vendor_dlkm_utils.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,20 @@ bool SplitRamdiskModules(const std::string& ramdisk_path,
458458
if (IsKernelModuleSigned(module_location)) {
459459
const auto system_dlkm_module_location =
460460
fmt::format("{}/{}", system_modules_dir, module_path);
461-
EnsureDirectoryExists(
461+
auto res = EnsureDirectoryExists(
462462
android::base::Dirname(system_dlkm_module_location));
463-
RenameFile(module_location, system_dlkm_module_location);
463+
CHECK(res.ok()) << res.error().FormatForEnv();
464+
auto ret = RenameFile(module_location, system_dlkm_module_location);
465+
CHECK(ret.ok()) << ret.error().FormatForEnv();
464466
system_dlkm_modules.emplace(module_path);
465467
} else {
466468
const auto vendor_dlkm_module_location =
467469
fmt::format("{}/{}", vendor_modules_dir, module_path);
468-
EnsureDirectoryExists(
470+
auto res = EnsureDirectoryExists(
469471
android::base::Dirname(vendor_dlkm_module_location));
470-
RenameFile(module_location, vendor_dlkm_module_location);
472+
CHECK(res.ok()) << res.error().FormatForEnv();
473+
auto ret = RenameFile(module_location, vendor_dlkm_module_location);
474+
CHECK(ret.ok()) << ret.error().FormatForEnv();
471475
vendor_dlkm_modules.emplace(module_path);
472476
}
473477
}
@@ -492,7 +496,8 @@ bool SplitRamdiskModules(const std::string& ramdisk_path,
492496
if (FileExists(initramfs_blocklist_path)) {
493497
const auto vendor_dlkm_blocklist_path =
494498
fmt::format("{}/{}", vendor_modules_dir, "modules.blocklist");
495-
RenameFile(initramfs_blocklist_path, vendor_dlkm_blocklist_path);
499+
auto ret = RenameFile(initramfs_blocklist_path, vendor_dlkm_blocklist_path);
500+
CHECK(ret.ok()) << ret.error().FormatForEnv();
496501
}
497502

498503
// Write updated modules.dep and modules.load files

staging/host/libs/websocket/websocket_server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ void WebSocketServer::InitializeLwsObjects() {
148148
dyn_mounts_.push_back({
149149
.mount_next = nullptr,
150150
.mountpoint = path.c_str(),
151-
.mountpoint_len = static_cast<uint8_t>(path.size()),
152151
.origin = "__http_polling__",
153152
.def = nullptr,
154153
.protocol = nullptr,
@@ -162,6 +161,7 @@ void WebSocketServer::InitializeLwsObjects() {
162161
.cache_revalidate = 0,
163162
.cache_intermediaries = 0,
164163
.origin_protocol = LWSMPRO_CALLBACK, // dynamic
164+
.mountpoint_len = static_cast<uint8_t>(path.size()),
165165
.basic_auth_login_file = nullptr,
166166
});
167167
}
@@ -176,7 +176,6 @@ void WebSocketServer::InitializeLwsObjects() {
176176
static_mount_ = {
177177
.mount_next = next_mount,
178178
.mountpoint = "/",
179-
.mountpoint_len = 1,
180179
.origin = assets_dir_.c_str(),
181180
.def = "index.html",
182181
.protocol = nullptr,
@@ -190,6 +189,7 @@ void WebSocketServer::InitializeLwsObjects() {
190189
.cache_revalidate = 0,
191190
.cache_intermediaries = 0,
192191
.origin_protocol = LWSMPRO_FILE, // files in a dir
192+
.mountpoint_len = 1,
193193
.basic_auth_login_file = nullptr,
194194
};
195195

0 commit comments

Comments
 (0)