OSDN Git Service
(root)
/
android-x86
/
system-vold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b46a2f7
)
Check for errors in dup2
author
Paul Crowley
<paulcrowley@google.com>
Fri, 7 Dec 2018 20:23:25 +0000
(12:23 -0800)
committer
Paul Crowley
<paulcrowley@google.com>
Fri, 7 Dec 2018 20:23:25 +0000
(12:23 -0800)
Bug:
26735063
Test: adb shell sm partition disk:7,3 private && adb logcat -d
Change-Id: I3aa8d1f6183dd5e77f54f422482a54ea8197d768
Utils.cpp
patch
|
blob
|
history
diff --git
a/Utils.cpp
b/Utils.cpp
index
3bbdf3a
..
a77b1b6
100644
(file)
--- a/
Utils.cpp
+++ b/
Utils.cpp
@@
-312,7
+312,10
@@
status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::strin
}
}
pipe_read.reset();
- dup2(pipe_write.get(), STDOUT_FILENO);
+ if (dup2(pipe_write.get(), STDOUT_FILENO) == -1) {
+ PLOG(ERROR) << "dup2 in ForkExecvp";
+ _exit(EXIT_FAILURE);
+ }
pipe_write.reset();
execvp(argv[0], const_cast<char**>(argv.data()));
PLOG(ERROR) << "exec in ForkExecvp";