Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: lib/Support/Unix/Process.inc

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Support/Unix/Path.inc ('k') | lib/Support/Unix/Program.inc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Support/Unix/Process.inc
diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc
index a429bb3984c888a81bafe78031102c08686910ad..eaed72666f9c489ec72270219ba6e9802ad6ec52 100644
--- a/lib/Support/Unix/Process.inc
+++ b/lib/Support/Unix/Process.inc
@@ -265,6 +265,16 @@ std::error_code Process::FixupStandardFileDescriptors() {
}
std::error_code Process::SafelyCloseFileDescriptor(int FD) {
+ // @LOCALMOD-BEGIN: For NaCl, don't use pthread_sigmask, etc.
+ // They are stubs and fail with ENOSYS, which make this return
+ // an error.
+#ifdef __native_client__
+ int ErrnoFromClose = 0;
+ if (::close(FD) < 0)
+ ErrnoFromClose = errno;
+ return std::error_code(ErrnoFromClose, std::generic_category());
+#else
+
// Create a signal set filled with *all* signals.
sigset_t FullSet;
if (sigfillset(&FullSet) < 0)
@@ -297,6 +307,7 @@ std::error_code Process::SafelyCloseFileDescriptor(int FD) {
if (ErrnoFromClose)
return std::error_code(ErrnoFromClose, std::generic_category());
return std::error_code(EC, std::generic_category());
+#endif // @LOCALMOD-END
}
bool Process::StandardInIsUserInput() {
« no previous file with comments | « lib/Support/Unix/Path.inc ('k') | lib/Support/Unix/Program.inc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698