projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add an "after fork, before exec" callback
[folly.git]
/
folly
/
Subprocess.cpp
diff --git
a/folly/Subprocess.cpp
b/folly/Subprocess.cpp
index b517c55df33c54377ebb886b4bbd052b964ef69b..2a1c3bce686d4280615aea4f8bdefdcd7b21f62d 100644
(file)
--- a/
folly/Subprocess.cpp
+++ b/
folly/Subprocess.cpp
@@
-493,6
+493,13
@@
int Subprocess::prepareChild(const Options& options,
}
}
+ // The user callback comes last, so that the child is otherwise all set up.
+ if (options.dangerousPostForkPreExecCallback_) {
+ if (int error = (*options.dangerousPostForkPreExecCallback_)()) {
+ return error;
+ }
+ }
+
return 0;
}