Skip to content

Refactor RealEnvStore methods to use uv_os_getenv/setenv/unsetenv #27211

Closed
@joyeecheung

Description

@joyeecheung

From a glance I think the uv_os_* methods are adequate to replace our conditional switches in the RealEnvStore methods.

I think this is a good first issue if you are familiar with C++ and has some idea on how to use libuv methods, but you may need to read into the libuv implementation to make sure the refactor does not change the functionality.

Pointers:

const char* val = getenv(*key);

setenv(*key, *val, 1);

if (getenv(*key)) return 0;

unsetenv(*key);

docs:

http://docs.libuv.org/en/v1.x/misc.html?highlight=uv_os_getenv#c.uv_os_getenv
http://docs.libuv.org/en/v1.x/misc.html?highlight=uv_os_getenv#c.uv_os_setenv
http://docs.libuv.org/en/v1.x/misc.html?highlight=uv_os_getenv#c.uv_os_unsetenv

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.good first issueIssues that are suitable for first-time contributors.osIssues and PRs related to the os subsystem.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions