Replace all instances of C's getenv with C++'s std::getenv

This commit is contained in:
James Le Cuirot 2020-08-22 19:05:24 +01:00
parent d186548a53
commit 7aa110475e
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137
3 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ execSelfNonDaemonized()
}
bool alreadyDaemonized() {
return getenv("_BARRIER_DAEMONIZED") != NULL;
return std::getenv("_BARRIER_DAEMONIZED") != NULL;
}
#endif

View File

@ -18,7 +18,7 @@
#include "../DataDirectories.h"
#include <unistd.h> // sysconf
#include <stdlib.h> // getenv
#include <cstdlib> // getenv
#include <sys/types.h> // getpwuid(_r)
#include <pwd.h> // getpwuid(_r)
@ -63,7 +63,7 @@ static std::string profile_basedir()
#ifdef WINAPI_XWINDOWS
// linux/bsd adheres to freedesktop standards
// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
const char* dir = getenv("XDG_DATA_HOME");
const char* dir = std::getenv("XDG_DATA_HOME");
if (dir != NULL)
return dir;
return unix_home() + "/.local/share";

View File

@ -877,7 +877,7 @@ XWindowsScreen::openDisplay(const char* displayName)
{
// get the DISPLAY
if (displayName == NULL) {
displayName = getenv("DISPLAY");
displayName = std::getenv("DISPLAY");
if (displayName == NULL) {
displayName = ":0.0";
}