forked from facebook/folly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand environment-handling in folly
Summary: Extract the environment-as-STL-map logic out of `test::EnvVarSaver` and into a separate class `experimental::EnvironmentState` so that other code which needs to manipulate the environment can do so more easily. Add routines to set the process environment from the state of an `EnvironmentState`'s map, and to extract the environment in the forms required by `Subprocess` and the UNIX routines `execve` etc. Reviewed By: yfeldblum Differential Revision: D4713307 fbshipit-source-id: 6b1380dd29b9ba41c97b886814dd3eee91fc1c0f
- Loading branch information
1 parent
d91466d
commit 55cd50f
Showing
4 changed files
with
306 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2017 Facebook, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int main() { | ||
char* spork = getenv("spork"); | ||
if (!spork) { | ||
return 1; | ||
} | ||
return strcmp("foon", spork); | ||
} |
Oops, something went wrong.