diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-06-05 19:58:22 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-08-23 11:40:50 +0100 |
commit | 412538b3b9fb424c3af313815c3928a9ec221ad7 (patch) | |
tree | e459e1ced2ed8444a2a15f160e5ce239e20718bf /dbus/dbus-sysdeps.c | |
parent | 30fa2e1ace062314e9624b29239c2c7e9519e6c2 (diff) | |
download | dbus-412538b3b9fb424c3af313815c3928a9ec221ad7.tar.gz |
Export dbus_setenv() as a utility function
It's sufficiently portable that GLib has an equivalent, and I really
don't want to have to either open-code it in dbus-run-session or
link dbus-run-session statically. We have enough statically-linked
rubbish already.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r-- | dbus/dbus-sysdeps.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index 0fbf9e71..de3a18cb 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -29,6 +29,7 @@ #include "dbus-protocol.h" #include "dbus-string.h" #include "dbus-list.h" +#include "dbus-misc.h" /* NOTE: If you include any unix/windows-specific headers here, you are probably doing something * wrong and should be putting some code in dbus-sysdeps-unix.c or dbus-sysdeps-win.c. @@ -92,6 +93,8 @@ _dbus_abort (void) } /** + * @ingroup DBusMisc + * * Wrapper for setenv(). If the value is #NULL, unsets * the environment variable. * @@ -100,13 +103,16 @@ _dbus_abort (void) * we can not rely on internal implementation details of * the underlying libc library. * + * This function is not thread-safe, because altering the environment + * in Unix is not thread-safe in general. + * * @param varname name of environment variable - * @param value value of environment variable - * @returns #TRUE on success. + * @param value value of environment variable, or #NULL to unset + * @returns #TRUE on success, #FALSE if not enough memory. */ dbus_bool_t -_dbus_setenv (const char *varname, - const char *value) +dbus_setenv (const char *varname, + const char *value) { _dbus_assert (varname != NULL); |