mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-04 13:22:15 +00:00
test: expose setenv, unsetenv and use_safe_putenv
mostly for local leak testing with valgrind Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
e780222ea7
commit
d2b6ea3f12
@ -113,6 +113,21 @@ mod export {
|
||||
Ok("worked")
|
||||
}
|
||||
}
|
||||
|
||||
#[export]
|
||||
fn use_safe_putenv(on: bool) {
|
||||
perlmod::ffi::use_safe_putenv(on);
|
||||
}
|
||||
|
||||
#[export]
|
||||
fn set_env(name: &str, value: &str) {
|
||||
std::env::set_var(name, value);
|
||||
}
|
||||
|
||||
#[export]
|
||||
fn unset_env(name: &str) {
|
||||
std::env::remove_var(name);
|
||||
}
|
||||
}
|
||||
|
||||
#[perlmod::package(name = "RSPM::EnvVarLibrary", lib = "x-${CARGO_PKG_NAME}-y")]
|
||||
|
Loading…
Reference in New Issue
Block a user