Loading adb/client/usb_libusb.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <atomic> #include <chrono> #include <condition_variable> #include <memory> #include <mutex> #include <string> Loading adb/transport.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -952,10 +952,18 @@ static void append_transport(const atransport* t, std::string* result, bool long } std::string list_transports(bool long_listing) { std::string result; std::lock_guard<std::recursive_mutex> lock(transport_lock); for (const auto& t : transport_list) { auto sorted_transport_list = transport_list; sorted_transport_list.sort([](atransport*& x, atransport*& y) { if (x->type != y->type) { return x->type < y->type; } return strcmp(x->serial, y->serial) < 0; }); std::string result; for (const auto& t : sorted_transport_list) { append_transport(t, &result, long_listing); } return result; Loading debuggerd/crasher/crasher.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ noinline int do_action(const char* arg) { munmap(map, sizeof(int)); map[0] = '8'; } else if (!strcasecmp(arg, "seccomp")) { set_seccomp_filter(); set_system_seccomp_filter(); syscall(99999); #if defined(__arm__) } else if (!strcasecmp(arg, "kuser_helper_version")) { Loading fs_mgr/fs_mgr.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/unique_fd.h> #include <cutils/android_filesystem_config.h> #include <cutils/android_reboot.h> #include <cutils/partition_utils.h> #include <cutils/properties.h> Loading Loading @@ -353,7 +354,7 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r reserved_blocks = max_reserved_blocks; } if (ext4_r_blocks_count(sb) == reserved_blocks) { if ((ext4_r_blocks_count(sb) == reserved_blocks) && (sb->s_def_resgid == AID_RESERVED_DISK)) { return; } Loading @@ -363,11 +364,12 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r return; } char buf[32]; const char* argv[] = {TUNE2FS_BIN, "-r", buf, blk_device}; snprintf(buf, sizeof(buf), "%" PRIu64, reserved_blocks); LINFO << "Setting reserved block count on " << blk_device << " to " << reserved_blocks; auto reserved_blocks_str = std::to_string(reserved_blocks); auto reserved_gid_str = std::to_string(AID_RESERVED_DISK); const char* argv[] = { TUNE2FS_BIN, "-r", reserved_blocks_str.c_str(), "-g", reserved_gid_str.c_str(), blk_device}; if (!run_tune2fs(argv, ARRAY_SIZE(argv))) { LERROR << "Failed to run " TUNE2FS_BIN " to set the number of reserved blocks on " << blk_device; Loading fs_mgr/fs_mgr_fstab.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -638,6 +638,7 @@ err: * frees up memory of the return value without touching a and b. */ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) { if (!a && !b) return nullptr; if (!a) return b; if (!b) return a; Loading @@ -654,12 +655,13 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) } for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { // copy the pointer directly *without* malloc and memcpy // Copy the structs by assignment. a->recs[i] = b->recs[j]; } // Frees up b, but don't free b->recs[X] to make sure they are // accessible through a->recs[X]. // We can't call fs_mgr_free_fstab because a->recs still references the // memory allocated by strdup. free(b->recs); free(b->fstab_filename); free(b); Loading Loading @@ -754,15 +756,17 @@ struct fstab *fs_mgr_read_fstab_default() default_fstab = get_fstab_path(); } if (default_fstab.empty()) { LWARNING << __FUNCTION__ << "(): failed to find device default fstab"; struct fstab* fstab = nullptr; if (!default_fstab.empty()) { fstab = fs_mgr_read_fstab(default_fstab.c_str()); } else { LINFO << __FUNCTION__ << "(): failed to find device default fstab"; } // combines fstab entries passed in from device tree with // the ones found from default_fstab file struct fstab* fstab_dt = fs_mgr_read_fstab_dt(); struct fstab *fstab = fs_mgr_read_fstab(default_fstab.c_str()); // combines fstab entries passed in from device tree with // the ones found from default_fstab file return in_place_merge(fstab_dt, fstab); } Loading Loading
adb/client/usb_libusb.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <atomic> #include <chrono> #include <condition_variable> #include <memory> #include <mutex> #include <string> Loading
adb/transport.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -952,10 +952,18 @@ static void append_transport(const atransport* t, std::string* result, bool long } std::string list_transports(bool long_listing) { std::string result; std::lock_guard<std::recursive_mutex> lock(transport_lock); for (const auto& t : transport_list) { auto sorted_transport_list = transport_list; sorted_transport_list.sort([](atransport*& x, atransport*& y) { if (x->type != y->type) { return x->type < y->type; } return strcmp(x->serial, y->serial) < 0; }); std::string result; for (const auto& t : sorted_transport_list) { append_transport(t, &result, long_listing); } return result; Loading
debuggerd/crasher/crasher.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ noinline int do_action(const char* arg) { munmap(map, sizeof(int)); map[0] = '8'; } else if (!strcasecmp(arg, "seccomp")) { set_seccomp_filter(); set_system_seccomp_filter(); syscall(99999); #if defined(__arm__) } else if (!strcasecmp(arg, "kuser_helper_version")) { Loading
fs_mgr/fs_mgr.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/unique_fd.h> #include <cutils/android_filesystem_config.h> #include <cutils/android_reboot.h> #include <cutils/partition_utils.h> #include <cutils/properties.h> Loading Loading @@ -353,7 +354,7 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r reserved_blocks = max_reserved_blocks; } if (ext4_r_blocks_count(sb) == reserved_blocks) { if ((ext4_r_blocks_count(sb) == reserved_blocks) && (sb->s_def_resgid == AID_RESERVED_DISK)) { return; } Loading @@ -363,11 +364,12 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r return; } char buf[32]; const char* argv[] = {TUNE2FS_BIN, "-r", buf, blk_device}; snprintf(buf, sizeof(buf), "%" PRIu64, reserved_blocks); LINFO << "Setting reserved block count on " << blk_device << " to " << reserved_blocks; auto reserved_blocks_str = std::to_string(reserved_blocks); auto reserved_gid_str = std::to_string(AID_RESERVED_DISK); const char* argv[] = { TUNE2FS_BIN, "-r", reserved_blocks_str.c_str(), "-g", reserved_gid_str.c_str(), blk_device}; if (!run_tune2fs(argv, ARRAY_SIZE(argv))) { LERROR << "Failed to run " TUNE2FS_BIN " to set the number of reserved blocks on " << blk_device; Loading
fs_mgr/fs_mgr_fstab.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -638,6 +638,7 @@ err: * frees up memory of the return value without touching a and b. */ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) { if (!a && !b) return nullptr; if (!a) return b; if (!b) return a; Loading @@ -654,12 +655,13 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) } for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { // copy the pointer directly *without* malloc and memcpy // Copy the structs by assignment. a->recs[i] = b->recs[j]; } // Frees up b, but don't free b->recs[X] to make sure they are // accessible through a->recs[X]. // We can't call fs_mgr_free_fstab because a->recs still references the // memory allocated by strdup. free(b->recs); free(b->fstab_filename); free(b); Loading Loading @@ -754,15 +756,17 @@ struct fstab *fs_mgr_read_fstab_default() default_fstab = get_fstab_path(); } if (default_fstab.empty()) { LWARNING << __FUNCTION__ << "(): failed to find device default fstab"; struct fstab* fstab = nullptr; if (!default_fstab.empty()) { fstab = fs_mgr_read_fstab(default_fstab.c_str()); } else { LINFO << __FUNCTION__ << "(): failed to find device default fstab"; } // combines fstab entries passed in from device tree with // the ones found from default_fstab file struct fstab* fstab_dt = fs_mgr_read_fstab_dt(); struct fstab *fstab = fs_mgr_read_fstab(default_fstab.c_str()); // combines fstab entries passed in from device tree with // the ones found from default_fstab file return in_place_merge(fstab_dt, fstab); } Loading