* Return the internal kenv buffer for the variable name, if it exists. * If the dynamic kenv is initialized and the name is present, return * with kenv_lock held. */
| 623 | * with kenv_lock held. |
| 624 | */ |
| 625 | static char * |
| 626 | kenv_acquire(const char *name) |
| 627 | { |
| 628 | char *value; |
| 629 | |
| 630 | if (dynamic_kenv) { |
| 631 | mtx_lock(&kenv_lock); |
| 632 | value = _getenv_dynamic(name, NULL); |
| 633 | if (value == NULL) |
| 634 | mtx_unlock(&kenv_lock); |
| 635 | return (value); |
| 636 | } else |
| 637 | return (_getenv_static(name)); |
| 638 | } |
| 639 | |
| 640 | /* |
| 641 | * Undo a previous kenv_acquire() operation |
no test coverage detected