summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/dbus-common.c3
-rw-r--r--src/shared/log.c9
-rw-r--r--src/shared/missing.h10
3 files changed, 16 insertions, 6 deletions
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index b8229bd663..0c73d6c6a8 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -32,6 +32,7 @@
#include "log.h"
#include "dbus-common.h"
#include "util.h"
+#include "missing.h"
#include "def.h"
#include "strv.h"
@@ -121,7 +122,7 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *_private, DBusError
* try via XDG_RUNTIME_DIR first, then
* fallback to normal bus access */
- e = __secure_getenv("XDG_RUNTIME_DIR");
+ e = secure_getenv("XDG_RUNTIME_DIR");
if (e) {
char *p;
diff --git a/src/shared/log.c b/src/shared/log.c
index 847202d7d3..96634645bc 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -30,6 +30,7 @@
#include "log.h"
#include "util.h"
+#include "missing.h"
#include "macro.h"
#include "socket-util.h"
@@ -804,19 +805,19 @@ int log_set_max_level_from_string(const char *e) {
void log_parse_environment(void) {
const char *e;
- e = __secure_getenv("SYSTEMD_LOG_TARGET");
+ e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target %s. Ignoring.", e);
- e = __secure_getenv("SYSTEMD_LOG_LEVEL");
+ e = secure_getenv("SYSTEMD_LOG_LEVEL");
if (e && log_set_max_level_from_string(e) < 0)
log_warning("Failed to parse log level %s. Ignoring.", e);
- e = __secure_getenv("SYSTEMD_LOG_COLOR");
+ e = secure_getenv("SYSTEMD_LOG_COLOR");
if (e && log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
- e = __secure_getenv("SYSTEMD_LOG_LOCATION");
+ e = secure_getenv("SYSTEMD_LOG_LOCATION");
if (e && log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
}
diff --git a/src/shared/missing.h b/src/shared/missing.h
index 7fbb9259eb..c5bb71a504 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -26,6 +26,7 @@
#include <sys/resource.h>
#include <sys/syscall.h>
#include <fcntl.h>
+#include <stdlib.h>
#include <unistd.h>
#include <linux/oom.h>
@@ -218,7 +219,6 @@ static inline pid_t gettid(void) {
#endif
#ifndef HAVE_NAME_TO_HANDLE_AT
-
struct file_handle {
unsigned int handle_bytes;
int handle_type;
@@ -229,3 +229,11 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle
return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
}
#endif
+
+#ifndef HAVE_SECURE_GETENV
+# ifdef HAVE___SECURE_GETENV
+# define secure_getenv __secure_getenv
+# else
+# error neither secure_getenv nor __secure_getenv are available
+# endif
+#endif