]>
Commit | Line | Data |
---|---|---|
035507c8 KZ |
1 | #ifndef UTIL_LINUX_ENV_H |
2 | #define UTIL_LINUX_ENV_H | |
3 | ||
90af3fe3 | 4 | #include "c.h" |
05d8868d | 5 | #include "nls.h" |
90af3fe3 | 6 | |
e0b6ab56 | 7 | extern void sanitize_env(void); |
035507c8 KZ |
8 | extern char *safe_getenv(const char *arg); |
9 | ||
05d8868d KZ |
10 | |
11 | #ifndef XSETENV_EXIT_CODE | |
12 | # define XSETENV_EXIT_CODE EXIT_FAILURE | |
13 | #endif | |
14 | ||
e0b6ab56 | 15 | static inline void xsetenv(char const *name, char const *val, int overwrite) |
e557efde | 16 | { |
e0b6ab56 | 17 | if (setenv(name, val, overwrite) != 0) |
05d8868d | 18 | err(XSETENV_EXIT_CODE, _("failed to set the %s environment variable"), name); |
e557efde LN |
19 | } |
20 | ||
035507c8 | 21 | #endif /* UTIL_LINUX_ENV_H */ |
7eda085c | 22 |