Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 225763 Details for
Bug 312017
[gnome-overlay] new ebuild: >=gnome-base/gdm-2.30.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
from 2.26.1 version
gdm-2.29.92-fix-daemonize-regression.patch (text/plain), 3.85 KB, created by
Michael Weber (RETIRED)
on 2010-03-30 01:03:08 UTC
(
hide
)
Description:
from 2.26.1 version
Filename:
MIME Type:
Creator:
Michael Weber (RETIRED)
Created:
2010-03-30 01:03:08 UTC
Size:
3.85 KB
patch
obsolete
>From b9f261de75356be6e4ee94c0cc53f2edbd8fe4d2 Mon Sep 17 00:00:00 2001 >From: Dan Nicholson <dbn.lists@gmail.com> >Date: Tue, 14 Oct 2008 07:06:21 -0700 >Subject: [PATCH] Fork gdm-binary, except when -nodaemon is used > >gdm-binary now forks and the parent terminates, except when the >-nodaemon or --nodaemon options are used. This provides compatibility >with xdm. Fixes bug #550170. > >Updated for gdm-2.29.92 by Michael Weber gentoo at xmw dot de 20100330 > >diff -ru gdm-2.29.92.orig/work/gdm-2.29.92/daemon/main.c gdm-2.29.92/work/gdm-2.29.92/daemon/main.c >--- gdm-2.29.92.orig/work/gdm-2.29.92/daemon/main.c 2010-03-30 02:02:05.000000000 +0200 >+++ gdm-2.29.92/work/gdm-2.29.92/daemon/main.c 2010-03-30 02:07:27.000000000 +0200 >@@ -499,6 +499,57 @@ > return ret; > } > >+static void >+dup_dev_null (int fd, int flags) >+{ >+ int nullfd; >+ int dupfd; >+ >+ VE_IGNORE_EINTR (nullfd = open ("/dev/null", flags)); >+ if (G_UNLIKELY (nullfd < 0)) { >+ gdm_fail (_("Cannot open /dev/null: %s!"), >+ strerror (errno)); >+ exit (EXIT_FAILURE); >+ } >+ >+ VE_IGNORE_EINTR (dupfd = dup2 (nullfd, fd)); >+ if (G_UNLIKELY (dupfd < 0)) { >+ gdm_fail (_("Cannot duplicate /dev/null: %s!"), >+ strerror (errno)); >+ exit (EXIT_FAILURE); >+ } >+ >+ VE_IGNORE_EINTR (close (nullfd)); >+} >+ >+static void >+daemonify (void) >+{ >+ pid_t pid; >+ >+ pid = fork (); >+ >+ /* terminate the parent */ >+ if (pid > 0) >+ exit (EXIT_SUCCESS); >+ >+ if (G_UNLIKELY (pid < 0)) { >+ gdm_fail (_("fork () failed: %s!"), strerror (errno)); >+ exit (EXIT_FAILURE); >+ } >+ >+ if (G_UNLIKELY (setsid () < 0)) { >+ gdm_fail (_("setsid () failed: %s!"), strerror (errno)); >+ exit (EXIT_FAILURE); >+ } >+ >+ /* reopen stdin, stdout, stderr with /dev/null */ >+ dup_dev_null (STDIN_FILENO, O_RDONLY); >+ dup_dev_null (STDOUT_FILENO, O_RDWR); >+ dup_dev_null (STDERR_FILENO, O_RDWR); >+} >+ >+ > static gboolean > is_debug_set (void) > { >@@ -523,14 +574,17 @@ > DBusGConnection *connection; > GError *error; > int ret; >+ int i; > gboolean res; > gboolean xdmcp_enabled; > GdmSignalHandler *signal_handler; > static gboolean do_timed_exit = FALSE; > static gboolean print_version = FALSE; > static gboolean fatal_warnings = FALSE; >+ static gboolean no_daemon = FALSE; > static GOptionEntry entries [] = { > { "fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &fatal_warnings, N_("Make all warnings fatal"), NULL }, >+ { "nodaemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Do not fork into the background"), NULL }, > { "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL }, > { "version", 0, 0, G_OPTION_ARG_NONE, &print_version, N_("Print GDM version"), NULL }, > >@@ -547,6 +601,14 @@ > > g_type_init (); > >+ /* preprocess the arguments to support the xdm style >+ * -nodaemon option >+ */ >+ for (i = 0; i < argc; i++) { >+ if (strcmp (argv[i], "-nodaemon") == 0) >+ argv[i] = "--nodaemon"; >+ } >+ > context = g_option_context_new (_("GNOME Display Manager")); > g_option_context_add_main_entries (context, entries, NULL); > g_option_context_set_ignore_unknown_options (context, TRUE); >@@ -612,7 +674,10 @@ > exit (-1); > } > >- /* pid file */ >+ if (no_daemon == FALSE) >+ daemonify (); >+ >+ /* pid file */ > delete_pid (); > write_pid (); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 312017
:
225759
|
225761
|
225763
|
226511