Skip to content

Commit

Permalink
Fix build in 5.1 tree
Browse files Browse the repository at this point in the history
Change-Id: I15f888d58c01de00920dc5c56148d363f4dd79b8
  • Loading branch information
Dees-Troy committed Apr 3, 2019
1 parent e4bdb15 commit 9a4d740
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion minuitwrp/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ endif
LOCAL_CLANG := true

LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils
LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++
ifneq ($(TW_INCLUDE_JPEG),)
LOCAL_SHARED_LIBRARIES += libjpeg
endif
Expand Down
6 changes: 4 additions & 2 deletions minuitwrp/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ int write_to_file(const std::string& fn, const std::string& line) {
int vibrate(int timeout_ms)
{
if (timeout_ms > 10000) timeout_ms = 1000;
char tout[6];
sprintf(tout, "%i", timeout_ms);

if (std::ifstream(LEDS_HAPTICS_ACTIVATE_FILE).good()) {
write_to_file(LEDS_HAPTICS_DURATION_FILE, std::to_string(timeout_ms));
write_to_file(LEDS_HAPTICS_DURATION_FILE, tout);
write_to_file(LEDS_HAPTICS_ACTIVATE_FILE, "1");
} else
write_to_file(VIBRATOR_TIMEOUT_FILE, std::to_string(timeout_ms));
write_to_file(VIBRATOR_TIMEOUT_FILE, tout);

return 0;
}
Expand Down
6 changes: 5 additions & 1 deletion partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,11 @@ bool TWPartition::Wipe_EXTFS(string File_System) {
if (NeedPreserveFooter)
Length < 0 ? dev_sz += Length : dev_sz -= CRYPT_FOOTER_OFFSET;

string size_str = to_string(dev_sz / 4096);
char dout[16];
sprintf(dout, "%llu", dev_sz / 4096);

//string size_str =to_string(dev_sz / 4096);
string size_str = dout;
string Command;

gui_msg(Msg("formatting_using=Formatting {1} using {2}...")(Display_Name)("mke2fs"));
Expand Down

0 comments on commit 9a4d740

Please sign in to comment.