summaryrefslogtreecommitdiff
path: root/boot_control_copy
diff options
context:
space:
mode:
authorBowgo Tsai <bowgotsai@google.com>2017-09-28 15:18:37 +0800
committerBowgo Tsai <bowgotsai@google.com>2017-09-28 15:31:07 +0800
commit4b7ef273872516874425356d5a6f218dcafdd505 (patch)
tree2c9e7eb159f9666564920a0a547717e46cbe3f10 /boot_control_copy
parent4f613859c824fe6a23fcc6a05621a3a65e38abb2 (diff)
downloadextras-4b7ef273872516874425356d5a6f218dcafdd505.tar.gz
boot_control_copy: switching to C++
fs_mgr_get_entry_for_mount_point() is switching to a C++ only API (using std::string). Do a minimum conversion here to adopt that change. Bug: 67024518 Test: make and boot sailfish Change-Id: I191fd0043815d75a799eb4001437abb107af6e79
Diffstat (limited to 'boot_control_copy')
-rw-r--r--boot_control_copy/Android.mk2
-rw-r--r--boot_control_copy/boot_control_copy.cpp (renamed from boot_control_copy/boot_control_copy.c)0
-rw-r--r--boot_control_copy/bootinfo.cpp (renamed from boot_control_copy/bootinfo.c)2
3 files changed, 2 insertions, 2 deletions
diff --git a/boot_control_copy/Android.mk b/boot_control_copy/Android.mk
index 3a5f8a08..fecd314c 100644
--- a/boot_control_copy/Android.mk
+++ b/boot_control_copy/Android.mk
@@ -3,7 +3,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := boot_control_copy.c bootinfo.c
+LOCAL_SRC_FILES := boot_control_copy.cpp bootinfo.cpp
LOCAL_CFLAGS := -Wall -Wno-missing-field-initializers -Wno-unused-parameter
LOCAL_C_INCLUDES := system/core/mkbootimg bootable/recovery
LOCAL_SHARED_LIBRARIES := libbase libcutils
diff --git a/boot_control_copy/boot_control_copy.c b/boot_control_copy/boot_control_copy.cpp
index d8a5d180..d8a5d180 100644
--- a/boot_control_copy/boot_control_copy.c
+++ b/boot_control_copy/boot_control_copy.cpp
diff --git a/boot_control_copy/bootinfo.c b/boot_control_copy/bootinfo.cpp
index dbc0757c..f21fe843 100644
--- a/boot_control_copy/bootinfo.c
+++ b/boot_control_copy/bootinfo.cpp
@@ -90,7 +90,7 @@ int boot_info_open_partition(const char *name, uint64_t *out_size, int flags)
}
trimmed_len = end_slash - record->blk_device + 1;
name_len = strlen(name);
- path = calloc(trimmed_len + name_len + 1, 1);
+ path = static_cast<char *>(calloc(trimmed_len + name_len + 1, 1));
strncpy(path, record->blk_device, trimmed_len);
strncpy(path + trimmed_len, name, name_len);
}