summaryrefslogtreecommitdiffstats
path: root/include/env.h
diff options
context:
space:
mode:
authorKarel Zak2016-08-16 12:35:57 +0200
committerKarel Zak2016-08-16 12:35:57 +0200
commit05d8868d86104c26aee8a1a30192243d0f9d2682 (patch)
treee878c026380c34b1a7cceca7bd3982160593a900 /include/env.h
parentMerge branch 'misc' of https://github.com/kerolasa/lelux-utiliteetit (diff)
downloadkernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.tar.gz
kernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.tar.xz
kernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.zip
include/env: minor fixes and clean ups
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/env.h')
-rw-r--r--include/env.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/env.h b/include/env.h
index ff5fc796e..db6f95932 100644
--- a/include/env.h
+++ b/include/env.h
@@ -2,14 +2,20 @@
#define UTIL_LINUX_ENV_H
#include "c.h"
+#include "nls.h"
extern void sanitize_env(void);
extern char *safe_getenv(const char *arg);
+
+#ifndef XSETENV_EXIT_CODE
+# define XSETENV_EXIT_CODE EXIT_FAILURE
+#endif
+
static inline void xsetenv(char const *name, char const *val, int overwrite)
{
if (setenv(name, val, overwrite) != 0)
- err(EXIT_FAILURE, _("failed to set the %s environment variable"), name);
+ err(XSETENV_EXIT_CODE, _("failed to set the %s environment variable"), name);
}
#endif /* UTIL_LINUX_ENV_H */