summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-07-20 01:06:50 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-07-20 01:06:50 +0200
commit6d8827e0d3e1563d6d7e7d47f955c0118059134c (patch)
treeb8f24a1af336f7fd0236e5ccf861ac2b15c383ed /install.cpp
parentMerge "Fix the missing char when showing recovery logs." (diff)
parentMerge "Fix the android-cloexec-* warnings in bootable/recovery" (diff)
downloadandroid_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar.gz
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar.bz2
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar.lz
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar.xz
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.tar.zst
android_bootable_recovery-6d8827e0d3e1563d6d7e7d47f955c0118059134c.zip
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/install.cpp b/install.cpp
index 7ba8f0139..7fbf5c01f 100644
--- a/install.cpp
+++ b/install.cpp
@@ -265,7 +265,7 @@ int update_binary_command(const std::string& package, ZipArchiveHandle zip,
}
unlink(binary_path.c_str());
- int fd = creat(binary_path.c_str(), 0755);
+ int fd = open(binary_path.c_str(), O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, 0755);
if (fd == -1) {
PLOG(ERROR) << "Failed to create " << binary_path;
return INSTALL_ERROR;