diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-03-25 04:35:41 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-03-25 04:35:41 +0000 |
commit | 2aac7c91d6a22da9af6ac791200ecae2fd64fd4e (patch) | |
tree | 767814e8ae339c1379444d061eb47c81a590e112 /user/mate-session-manager/no-systemd.patch | |
parent | 13fa4c900a5d7825c4802b12cecdf6e22e9dfac8 (diff) | |
parent | dc9e13229a7c2d216ec98a16075601b9540f7e53 (diff) | |
download | packages-2aac7c91d6a22da9af6ac791200ecae2fd64fd4e.tar.gz packages-2aac7c91d6a22da9af6ac791200ecae2fd64fd4e.tar.bz2 packages-2aac7c91d6a22da9af6ac791200ecae2fd64fd4e.tar.xz packages-2aac7c91d6a22da9af6ac791200ecae2fd64fd4e.zip |
Merge branch 'desktops.mate' into 'master'
Package the MATE desktop environment
See merge request !207
Diffstat (limited to 'user/mate-session-manager/no-systemd.patch')
-rw-r--r-- | user/mate-session-manager/no-systemd.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/user/mate-session-manager/no-systemd.patch b/user/mate-session-manager/no-systemd.patch new file mode 100644 index 000000000..79c19f34a --- /dev/null +++ b/user/mate-session-manager/no-systemd.patch @@ -0,0 +1,65 @@ +From 254a091b31517a25bc037b31daff27fbb74ac90d Mon Sep 17 00:00:00 2001 +From: Victor Kareh <vkareh@redhat.com> +Date: Wed, 6 Mar 2019 09:20:36 -0500 +Subject: [PATCH] Guard against missing systemd + +--- + mate-session/gsm-systemd.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/mate-session/gsm-systemd.c b/mate-session/gsm-systemd.c +index da3f23b..d03cafd 100644 +--- a/mate-session/gsm-systemd.c ++++ b/mate-session/gsm-systemd.c +@@ -429,16 +429,31 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + gboolean is_last_session; + int ret, i; + ++#ifdef HAVE_SYSTEMD + ret = sd_pid_get_session (getpid (), &session); ++#endif ++ ++ if (session == NULL) { ++ return FALSE; ++ } + + if (ret != 0) { ++ free (session); + return FALSE; + } + ++#ifdef HAVE_SYSTEMD + ret = sd_uid_get_sessions (getuid (), FALSE, &sessions); ++#endif ++ ++ if (sessions == NULL) { ++ free (session); ++ return FALSE; ++ } + + if (ret <= 0) { + free (session); ++ free (sessions); + return FALSE; + } + +@@ -450,7 +465,9 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + if (g_strcmp0 (sessions[i], session) == 0) + continue; + ++#ifdef HAVE_SYSTEMD + ret = sd_session_get_state (sessions[i], &state); ++#endif + + if (ret != 0) + continue; +@@ -461,7 +478,9 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + } + free (state); + ++#ifdef HAVE_SYSTEMD + ret = sd_session_get_type (sessions[i], &type); ++#endif + + if (ret != 0) + continue; |