Skip to content

Commit

Permalink
Mark detach option in folly::Subprocess deprecated
Browse files Browse the repository at this point in the history
Summary: fork is considered dangerous. Marking detach deprecated to discourage further usages.

Reviewed By: dmm-fb

Differential Revision: D68522771

fbshipit-source-id: 8dd560209c96acaa5d4b7322cff80f6edc51df78
  • Loading branch information
TJ Yin authored and facebook-github-bot committed Jan 23, 2025
1 parent e5e19df commit 9a021af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion folly/Subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ class Subprocess {
* "EXITED" state when the constructor returns. The caller should not call
* wait() or poll() on the Subprocess, and pid() will return -1.
*/
Options& detach() {
[[deprecated(
"detach() forks the current process, which is considered dangerous")]] Options&
detach() {
detach_ = true;
return *this;
}
Expand Down

0 comments on commit 9a021af

Please sign in to comment.