summaryrefslogtreecommitdiff
path: root/common/gdm-common.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-01-18 16:07:20 -0500
committerRay Strode <rstrode@redhat.com>2013-01-22 11:56:26 -0500
commita505c58cee7c1d4f397fb8c0903cc78221c308b4 (patch)
tree86eff58e95b797840a60949e1124fefd3096b815 /common/gdm-common.c
parent4952f6e5b023428e5f11f763531533c7b262f324 (diff)
downloadgdm-a505c58cee7c1d4f397fb8c0903cc78221c308b4.tar.gz
Log output to systemd journal if available
Previously, we put stuff in /var/log/gdm for the session, and then ~/.cache/gdm/session.log for the user. Now let's use explicit sd_journal_stream_fd() calls. Some adjustments from Ray Strode. https://bugzilla.gnome.org/show_bug.cgi?id=676181
Diffstat (limited to 'common/gdm-common.c')
-rw-r--r--common/gdm-common.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/gdm-common.c b/common/gdm-common.c
index faab0d7a..ae6129c2 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -66,6 +66,32 @@ gdm_is_version_unstable (void)
}
gboolean
+gdm_clear_close_on_exec_flag (int fd)
+{
+ int flags;
+
+ if (fd < 0) {
+ return FALSE;
+ }
+
+ flags = fcntl (fd, F_GETFD, 0);
+
+ if (flags < 0) {
+ return FALSE;
+ }
+
+ if ((flags & FD_CLOEXEC) != 0) {
+ int status;
+
+ status = fcntl (fd, F_SETFD, flags & ~FD_CLOEXEC);
+
+ return status != -1;
+ }
+
+ return TRUE;
+}
+
+gboolean
gdm_get_pwent_for_name (const char *name,
struct passwd **pwentp)
{