Fix the android-cloexec-* warnings in bootable/recovery

Add the O_CLOEXEC or 'e' accordingly.

Bug: 63510015
Test: recovery tests pass
Change-Id: I7094bcc6af22c9687eb535116b2ca6a59178b303
This commit is contained in:
Tianjie Xu
2017-07-10 15:13:33 -07:00
parent 8155a8ba74
commit de6735e80c
7 changed files with 116 additions and 117 deletions
+1 -1
View File
@@ -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;