Created
April 23, 2019 18:14
-
-
Save gszr/dbfe4762340637e25b03725f47aaa758 to your computer and use it in GitHub Desktop.
setenv
This file contains hidden or 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
diff --git a/spec/helpers.lua b/spec/helpers.lua | |
index 85e9589d6..061ac68d0 100644 | |
--- a/spec/helpers.lua | |
+++ b/spec/helpers.lua | |
@@ -1415,4 +1415,11 @@ return { | |
ngx.ctx.workspaces = old_ws | |
return res | |
end, | |
+ setenv = function(env, value) | |
+ local ffi = require "ffi" | |
+ ffi.cdef[[ | |
+ int setenv(const char *name, const char *value, int overwrite); | |
+ ]] | |
+ return ffi.C.setenv(env, value, 1) == 0 | |
+ end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment