chore use std::getenv Not c style getenv
idea from: https://github.com/debauchee/barrier/pull/847/
This commit is contained in:
@ -41,7 +41,7 @@ int execSelfNonDaemonized()
|
||||
|
||||
bool alreadyDaemonized()
|
||||
{
|
||||
return getenv("_DESKFLOW_DAEMONIZED") != nullptr;
|
||||
return std::getenv("_DESKFLOW_DAEMONIZED") != nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -30,7 +30,7 @@ const auto kHasPortalInputCapture = false;
|
||||
|
||||
inline bool isWayland()
|
||||
{
|
||||
const auto session = getenv("XDG_SESSION_TYPE");
|
||||
const auto session = std::getenv("XDG_SESSION_TYPE");
|
||||
return session != nullptr && std::string(session) == "wayland";
|
||||
}
|
||||
|
||||
|
||||
@ -834,7 +834,7 @@ Display *XWindowsScreen::openDisplay(const char *displayName)
|
||||
{
|
||||
// get the DISPLAY
|
||||
if (displayName == nullptr) {
|
||||
displayName = getenv("DISPLAY");
|
||||
displayName = std::getenv("DISPLAY");
|
||||
if (displayName == nullptr) {
|
||||
displayName = ":0.0";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user