Coverage Report

Created: 2024-05-21 06:33

/src/util-linux/include/env.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * No copyright is claimed.  This code is in the public domain; do with
3
 * it what you wish.
4
 */
5
#ifndef UTIL_LINUX_ENV_H
6
#define UTIL_LINUX_ENV_H
7
8
#include "c.h"
9
#include "nls.h"
10
11
struct ul_env_list;
12
13
extern void sanitize_env(void);
14
extern void __sanitize_env(struct ul_env_list **org);
15
16
extern int env_list_setenv(struct ul_env_list *ls);
17
extern void env_list_free(struct ul_env_list *ls);
18
extern struct ul_env_list *env_from_fd(int pid);
19
20
extern char *safe_getenv(const char *arg);
21
22
23
#ifndef XSETENV_EXIT_CODE
24
# define XSETENV_EXIT_CODE EXIT_FAILURE
25
#endif
26
27
static inline void xsetenv(char const *name, char const *val, int overwrite)
28
0
{
29
0
  if (setenv(name, val, overwrite) != 0)
30
0
    err(XSETENV_EXIT_CODE, _("failed to set the %s environment variable"), name);
31
0
}
Unexecuted instantiation: cache.c:xsetenv
Unexecuted instantiation: config.c:xsetenv
Unexecuted instantiation: env.c:xsetenv
32
33
static inline int remove_entry(char **argv, int remove, int last)
34
0
{
35
0
  memmove(argv + remove, argv + remove + 1, sizeof(char *) * (last - remove));
36
0
  return last - 1;
37
0
}
Unexecuted instantiation: cache.c:remove_entry
Unexecuted instantiation: config.c:remove_entry
Unexecuted instantiation: env.c:remove_entry
38
39
#endif /* UTIL_LINUX_ENV_H */